Skip to content

Commit

Permalink
fix bug in MSE color mean loss
Browse files Browse the repository at this point in the history
  • Loading branch information
cuttle-fish-my committed May 19, 2023
1 parent 2ea23c9 commit 4257c98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def p_losses(denoise_model, img, R, T, K, logsnr, noise=None, loss_type="l2", co
rec_color_mean = torch.mean(rec_img, dim=(2, 3))

color_loss = torch.nn.MSELoss()
color_loss = (logsnr.to(dev()) + 20) / 20 * color_loss(img_color_mean.to(dev()), rec_color_mean)
color_loss = (logsnr.to(dev()) + 20) / 20 * color_loss(img_color_mean.to(dev()), rec_color_mean).mean()

return loss + color_loss

Expand Down

0 comments on commit 4257c98

Please sign in to comment.