fix: correct operator precedence in lvlb_weights calculation - #907
fix: correct operator precedence in lvlb_weights calculation#907Mr-Neutr0n wants to merge 1 commit into
Conversation
|
This single-line fix corrects the operator precedence in the x0 parameterization branch of lvlb_weights. Without the parentheses around |
|
Closing this one to tidy up my open pull requests. It's been open around five months with no review activity, and I'd rather withdraw it than leave it sitting in your queue. Nothing needed from you, and no hard feelings at all. If the fix is still wanted, this can be reopened, or I'm happy to redo it properly against current main. Apologies for the noise. |
Bug
In the lvlb_weights calculation, the expression
1 - alphas_cumprod_prev / 1. - alphas_cumprodis parsed as1 - (alphas_cumprod_prev / 1.) - alphas_cumproddue to Python operator precedence, instead of the intended(1 - alphas_cumprod_prev) / (1 - alphas_cumprod).Fix
Added parentheses to ensure correct precedence matching the DDPM paper's posterior variance formula.