Skip to content
Back to skills

Gradient Stat Annealing

ASecurity

Update PINN data-loss weights from residual and data-fit gradient statistics using the paper's moving-average annealing rule.

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
testingpython

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill gradient_stat_annealing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gradient Stat Annealing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gradient Stat Annealing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-gradient-stat-annealing/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-gradient-stat-annealing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: gradient_stat_annealing
description: Update PINN data-loss weights from residual and data-fit gradient statistics using the paper's moving-average annealing rule.
---

# Gradient Statistic Annealing

Use this skill when a composite PINN loss keeps residual and data-fit losses separate and needs the paper's adaptive lambda update. Do not use it when only aggregate loss gradients are available.

## Inputs

- Residual-gradient magnitudes or a residual-gradient vector.
- One or more data-fit gradient vectors.
- Current lambda values.
- Smoothing coefficient `alpha` and numerical `epsilon`.

## Outputs

- Updated lambdas.
- Instantaneous lambda estimates.
- Residual max-gradient statistic and data mean-gradient statistics.
- Balance ratios for recovery mechanism checks.

## Workflow

1. Compute `max(abs(grad L_r))`.
2. Compute `mean(abs(grad L_i))` for each data-fit loss.
3. Compute `lambda_hat_i = max_grad_r / (mean_grad_i + epsilon)`.
4. Apply `lambda_i = (1 - alpha) * lambda_i + alpha * lambda_hat_i`.
5. Log all values in the training trace.

## Validation

Run `python scripts/annealing.py --self-test` or the generated skill tests.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…