界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

gradient_stat_annealing

gradient_stat_annealing

【数据与研究】Update PINN data-loss weights from residual and data-fit gradient statistics using the paper's moving-average annealing rule.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

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.

我的收藏