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

adaptive_apgd_loop

adaptive_apgd_loop

【效率与协作】Run a deterministic APGD-style projected attack with loss-history step adaptation and auditable traces.

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

技能说明

GitHub

name: adaptive_apgd_loop description: Run a deterministic APGD-style projected attack with loss-history step adaptation and auditable traces.

Adaptive APGD Loop

Use this skill to recover or test the APGD mechanism from AutoAttack when a bounded, deterministic implementation is needed. Do not treat this pure-Python finite-difference implementation as a high-throughput replacement for framework autograd attacks.

Inputs

  • Logit function accepting one vector.
  • Examples and labels.
  • Projection and loss helpers.
  • Norm, epsilon, iterations, initial step size, and adaptation window.

Outputs

  • Adversarial examples and predictions.
  • Per-example success flags.
  • Loss trace and step-size adaptation events.

Workflow

  1. Start from the clean example or a deterministic offset inside the threat ball.
  2. Estimate the loss gradient with finite differences.
  3. Take an ascent step and project back to the threat model.
  4. Track the best loss and adversarial point.
  5. On non-improving windows, halve step size and continue from the best point.

Validation

Run python tests/test_apgd.py or the skill-tree validator.

Limitations

Finite differences are only for compact recovery evidence. Production use should substitute exact gradients while preserving the same adaptation and projection contracts.

我的收藏