计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
ddpm_adaptation_protocol【效率与协作】Build shared noised DDPM adaptation batches and reconstruct clean-image predictions for source and adapted denoisers.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when implementing or auditing DDPM-PA style few-shot adaptation. It prepares the shared noised inputs used by a frozen source denoiser and a trainable adapted denoiser, then reconstructs predicted clean images with the paper's Equation 15.
Do not use this skill to compute pairwise KL or high-frequency losses directly; those are separate module contracts. This skill owns only the noising, denoiser-call alignment, reconstruction formula, and metadata needed by downstream losses.
[batch, channels, height, width].alpha_bar_t with 0 < alpha_bar_t <= 1.x_t.x_t.source_x0_hat and adapted_x0_hat.alpha_bar_t.x_t = sqrt(alpha_bar_t) * x0 + sqrt(1 - alpha_bar_t) * epsilon.x0_hat = (x_t - sqrt(1 - alpha_bar_t) * predicted_epsilon) / sqrt(alpha_bar_t) for each branch.Run:
python scripts/ddpm_protocol.py --smoke
python -m pytest tests
The tests verify deterministic noising and exact reconstruction when predicted noise equals the injected noise.
The script uses standard-library nested-list math for portability. Full diffusion training code may wrap the same formulas in NumPy, PyTorch, or JAX, but must preserve shared x_t and branch-aligned reconstruction semantics.