# Ddpm Pa Recovery Harness

> Run a bounded DDPM-PA proxy optimizer step and emit mechanism-faithful recovery traces and metrics.

- Skill: `yzj623/ddpm-pa-recovery-harness` (Agent Skill)
- Install (CLI): `npx get-skill add yzj623/ddpm-pa-recovery-harness`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yzj623/ddpm-pa-recovery-harness/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: yzj623 (https://skillmd.com/u/yzj623)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/yzj623/ddpm-pa-recovery-harness

---


# DDPM-PA Recovery Harness

Use this skill when full DDPM-PA few-shot image generation is blocked by missing checkpoints, datasets, or image-quality evaluators, but soft-mode recovery permits a declared mechanism-faithful proxy. The skill combines the adaptation protocol, pairwise image preservation, high-frequency preservation, high-frequency MSE, and an optimizer update into an auditable reduced experiment.

Do not use this skill to claim full FID or Intra-LPIPS reproduction unless a real pretrained DDPM, target images, sampling loop, and evaluators ran. In proxy mode it validates the adaptation mechanism, not the paper's final image metric.

## Inputs

- Module-plan recovery target metadata.
- Runtime handoff explaining full-runtime blockers and soft-mode permission.
- Generated skill script roots for protocol, pairwise loss, and Haar high-frequency loss.
- Lambda weights consistent with the paper: `lambda2` and `lambda3` in `[0.1, 1.0]`, `lambda4` in `[0.01, 0.08]` unless an ablation intentionally changes them.

## Outputs

- `training_trace.json` with loss values, component losses, `params_before`, `params_after`, and optimizer evidence.
- Mechanism checks for shared noising, x0 reconstruction, image pairwise KL, high-frequency pairwise KL, high-frequency MSE, and parameter update.
- A recovery metric such as `combined_loss_delta` generated by an executable command.

## Workflow

1. Read the module plan and runtime handoff before selecting proxy mode.
2. Construct a tiny deterministic target batch and scalar trainable adapted-denoiser parameters.
3. Use generated module scripts to compute noised/reconstructed samples, pairwise KL, and high-frequency losses.
4. Combine loss components using paper-consistent lambda weights.
5. Estimate a deterministic finite-difference gradient and update adapted parameters.
6. Save traces and mechanism checks; never hand-write final metrics outside the command.

## Validation

Run:

```bash
python scripts/proxy_step.py --output /tmp/ddpm_pa_proxy.json
python -m pytest tests
```

The tests assert finite loss, changed parameters, complete mechanism booleans, and target-compatible output fields.

## Limitations

The default script is intentionally tiny and standard-library only. It is a proxy for the DDPM-PA loss geometry and optimizer execution, not an image generation benchmark.

## Cycle 1 refinement note

A zero-pairwise ablation must be recorded as an ablation rather than a valid DDPM-PA mechanism run, because it removes both source-referenced preservation losses even if the base proxy loss still decreases.

