Skip to content

Commit

Permalink
fix precision problem?
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneofsimo committed Feb 12, 2023
1 parent 9380060 commit afbcea1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lora_diffusion/cli_lora_pti.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ def loss_step(

target = target * mask

loss = F.mse_loss(model_pred.float(), target.float(), reduction="mean")
loss = F.mse_loss(model_pred.float(), target.float(), reduction="none")
loss = loss.sum(0).mean()

return loss


Expand Down

0 comments on commit afbcea1

Please sign in to comment.