Repository navigation
Add EDM-style noise schedules for VEScoreEstimator - #1754
Conversation
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
Implements configurable noise schedules from Karras et al. (2022) "Elucidating the Design Space of Diffusion-Based Generative Models": - train_schedule: "uniform" (default) | "lognormal" - solve_schedule: "uniform" (default) | "power_law" - Parameters: lognormal_mean, lognormal_std, power_law_exponent Includes input validation and numerical stability: - Validates sigma bounds (sigma_min > 0, sigma_max > sigma_min) - Log-space clamping in lognormal schedule to prevent NaN - Warning when >5% of samples require clamping - Explicit boundary assignment in power-law schedule References: https://arxiv.org/abs/2206.00364
- Extract sigma_min, sigma_max, and schedule params for VE estimators - Update docstrings for solve_schedule usage - Add comment clarifying VE simulation budget in tests
- test_ve_edm_schedules: all schedule combinations - test_ve_lognormal_no_nan_with_extreme_params: numerical stability
d1e2f68 to
f625a41
Compare
|
The defaults we chose are from the Karras et al. paper, so moderate noise levels for image generation tasks. For the benchmarking tasks, the best schedule parameters were quite different from the defaults: Task: two_moons
Task: linear_mvg_2d
Task: gaussian_linear
Task: slcp
Heuristics:
For a how-to guide or tutorial, we should say something like: if your posterior is much narrower than your prior, increase lognormal_mean toward 0 or above. If your posterior is multimodal, decrease it toward -3. When in doubt, use Optuna to optimize setting so a held-out validation set using negative posterior log prob as metric. |

Extends
VEScoreEstimatorwith configurable noise schedules from Karras et al. (2022) "Elucidating the Design Space of Diffusion-Based Generative Models". This follows up on #1736, which refactored schedule methods into the base class but deferred EDM-specific schedules pending benchmarking.This applies only to VE score estimators. The EDM papers suggests to use log-normal / geometric time schedules for the training and power-law time schedules for the ODE / SDE solving schedules. So, instead of a uniform schedule, we use:
exp(P_mean + P_std * z), converts to time via VE's geometric relationshipσ_i = (σ_max^(1/ρ) + i/(N-1) * (σ_min^(1/ρ) - σ_max^(1/ρ)))^ρ, concentrates steps at low noiseBecause these schedules can lead to numerical instabilities in edge cases, this PR also adds:
log(negative)The hyperparameters are exposed to the user via the build function and
posterior_nn:build_vector_field_estimatornow passessigma_min,sigma_max, and all schedule parameters to VE estimatorsposterior_score_nnaccepts these parameters whensde_type="ve"All new parameters have defaults matching previous uniform behavior. Existing code is unaffected.
Example
Benchmarking
I am currently running benchmarks to compare against uniform schedules, will post them here once done.
References