Skip to content

Commit

Permalink
Added range computation for the torchmetrics call
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixSteinbauer authored Aug 10, 2023
1 parent 5690df7 commit 24d175f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GANDLF/metrics/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def peak_signal_noise_ratio(target, prediction, data_range=None, epsilon=None) -
"""

if epsilon == None:
psnr = PeakSignalNoiseRatio(data_range=data_range)
psnr = PeakSignalNoiseRatio() if data_range == None else PeakSignalNoiseRatio(data_range=data_range[1]-data_range[0])
return psnr(preds=prediction, target=target)
else: # implementation of PSNR that does not give 'inf'/'nan' when 'mse==0'
mse = mean_squared_error(target, prediction)
Expand Down

0 comments on commit 24d175f

Please sign in to comment.