LION.metrics.psnr¶
Classes
|
PSNR, from |
- class LION.metrics.psnr.PSNR[source]¶
Bases:
ModulePSNR, from
skimage.metrics.peak_signal_noise_ratio, for (potentially) batched pytorch tensors. A score: higher is better.Initialize internal Module state, shared by both nn.Module and ScriptModule.
- higher_is_better = True¶
- forward(x, target, reduce=None, batched=True, data_range=None)[source]¶
The PSNR of
xagainsttarget(the same shape): one per sample ifbatched(the first axis), or their mean ifreduceis “mean”.data_range: the range of the image values (e.g. 1 for images in [0, 1]); None: each target’s (max - min).