Skip to content

Commit

Permalink
Update como.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenye234 committed Oct 23, 2023
1 parent 01efbe3 commit 255856e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/como.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def EDMLoss(self, x_start, cond,nonpadding ):
n = (torch.randn_like(x_start)+cond ) * sigma
D_yn = self.EDMPrecond(x_start + n, sigma ,cond,self.denoise_fn,nonpadding)
loss = (weight * ((D_yn - x_start) ** 2))
loss=loss*nonpadding.unsqueeze(1).unsqueeze(1)
loss=loss*nonpadding
loss=loss.mean()
return loss

Expand Down Expand Up @@ -361,7 +361,7 @@ def CTLoss_D(self,y, cond,nonpadding): #k


loss = (f_theta - f_theta_ema.detach()) ** 2
loss=loss*nonpadding.unsqueeze(1).unsqueeze(1)
loss=loss*nonpadding
loss=loss.mean()


Expand Down

0 comments on commit 255856e

Please sign in to comment.