73cb3ff00533b03ab64127d2287f9bdfe30c035c,kornia/losses/psnr.py,,psnr_loss,#,47
Before Change
raise TypeError(f"Expected 2 torch tensors but got {type(input)} and {type(target)}")
if input.shape != target.shape:
raise TypeError(f"Expected tensors of equal shapes, but got {input.shape} and {target.shape}")
mse_val = mse_loss(input, target, reduction="mean")
max_val_tensor: torch.Tensor = torch.tensor(max_val).to(input.device).to(input.dtype)
return 10 * torch.log10(max_val_tensor * max_val_tensor / mse_val)
After Change
tensor(-20.0000)
return -1. * psnr(input, target, max_val)
class PSNRLoss(nn.Module):
rCreates a criterion that calculates the PSNR loss.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: arraiy/torchgeometry
Commit Name: 73cb3ff00533b03ab64127d2287f9bdfe30c035c
Time: 2021-01-16
Author: edgar.riba@gmail.com
File Name: kornia/losses/psnr.py
Class Name:
Method Name: psnr_loss
Project Name: brilee/MuGo
Commit Name: 708c4ab3cdec80ff66bbc6ad10f10df79d33369c
Time: 2016-06-06
Author: brian.kihoon.lee@gmail.com
File Name: strategies.py
Class Name: BaseStrategy
Method Name: suggest_move
Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: kornia/filters/sobel.py
Class Name: Sobel
Method Name: forward