We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0958d84 + f4a66ee commit a64400cCopy full SHA for a64400c
crm/imagedream/ldm/interface.py
@@ -112,11 +112,12 @@ def register_schedule(
112
self.register_buffer(
113
"log_one_minus_alphas_cumprod", to_torch(np.log(1.0 - alphas_cumprod))
114
)
115
+ eps = 1e-8 # Added this epsilon to avoid divide by zero errors
116
- "sqrt_recip_alphas_cumprod", to_torch(np.sqrt(1.0 / alphas_cumprod))
117
+ "sqrt_recip_alphas_cumprod", to_torch(np.sqrt(1.0 / (alphas_cumprod + eps)))
118
119
- "sqrt_recipm1_alphas_cumprod", to_torch(np.sqrt(1.0 / alphas_cumprod - 1))
120
+ "sqrt_recipm1_alphas_cumprod", to_torch(np.sqrt(1.0 / (alphas_cumprod + eps) - 1))
121
122
123
# calculations for posterior q(x_{t-1} | x_t, x_0)
0 commit comments