Skip to content

Commit 57d199d

Browse files
fix: add eps to v-objective to hopefully fix NaNs
1 parent 58db626 commit 57d199d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

audio_diffusion_pytorch/diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def forward(self, x: Tensor, noise: Tensor = None, **kwargs) -> Tensor:
161161
x_pred = self.net(c_in * x_noisy, self.sigma_to_t(sigmas), **kwargs)
162162

163163
# Compute v-objective target
164-
v_target = (x - c_skip * x_noisy) / c_out
164+
v_target = (x - c_skip * x_noisy) / (c_out + 1e-7)
165165

166166
# Compute loss
167167
loss = F.mse_loss(x_pred, v_target)

0 commit comments

Comments
 (0)