image_pred and image_gt: (1, 3, H, W)
(image_pred, image_gt, reduction='mean')
| 13 | return -10*torch.log10(mse(image_pred, image_gt, valid_mask, reduction)) |
| 14 | |
| 15 | def ssim(image_pred, image_gt, reduction='mean'): |
| 16 | """ |
| 17 | image_pred and image_gt: (1, 3, H, W) |
| 18 | """ |
| 19 | dssim_ = dssim(image_pred, image_gt, 3, reduction) # dissimilarity in [0, 1] |
| 20 | return 1-2*dssim_ # in [-1, 1] |
nothing calls this directly
no outgoing calls
no test coverage detected