Skip to content

fix: correct operator precedence in lvlb_weights calculation#907

Open
Mr-Neutr0n wants to merge 1 commit intoCompVis:mainfrom
Mr-Neutr0n:fix/lvlb-weights-operator-precedence
Open

fix: correct operator precedence in lvlb_weights calculation#907
Mr-Neutr0n wants to merge 1 commit intoCompVis:mainfrom
Mr-Neutr0n:fix/lvlb-weights-operator-precedence

Conversation

@Mr-Neutr0n
Copy link

Bug

In the lvlb_weights calculation, the expression 1 - alphas_cumprod_prev / 1. - alphas_cumprod is parsed as 1 - (alphas_cumprod_prev / 1.) - alphas_cumprod due 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant