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

atomic_loss_training

atomic_loss_training

【效率与协作】Build and optimize the finite-atom APT contrastive loss with proposal posterior correction.

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

技能说明

GitHub

name: atomic_loss_training description: Build and optimize the finite-atom APT contrastive loss with proposal posterior correction.

Atomic Loss Training

Use this skill to implement the APT finite-atom objective from Section 3.2. It is appropriate for reduced recovery, ablations, and deterministic tests where the posterior estimator is represented by a simple differentiable score function.

Inputs

  • Atom parameter values and the index of the positive simulated parameter.
  • Observation value and affine score parameters.
  • Prior and proposal log-density values for the atoms.
  • Learning rate for one optimizer step.

Outputs

  • Cross-entropy loss before and after update.
  • Probability assigned to the positive atom.
  • Parameter values before and after the optimizer step.

Workflow

  1. Score each atom with an observation-conditioned affine model.
  2. Apply the proposal-posterior transform before computing probabilities.
  3. Compute cross-entropy against the positive atom.
  4. Compute analytic gradients and update trainable parameters.
  5. Record a trace compatible with recovery validation.

Validation

Run python scripts/atomic_loss.py --self-test. The deterministic test verifies that the optimizer changes parameters and reduces loss.

Limitations

The provided script is a compact recovery implementation. Full APT normally uses neural density estimators such as mixtures or flows.

我的收藏