LION.metrics.ssim¶
Classes
|
SSIM, from |
- class LION.metrics.ssim.SSIM[source]¶
Bases:
ModuleSSIM, from
skimage.metrics.structural_similarity, 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, channel_axis=None, data_range=None)[source]¶
The SSIM of
xagainsttarget(the same shape): one per sample ifbatched(the first axis), or their mean ifreduceis “mean”.channel_axis: the channel axis of colour images (None: grayscale, or axis 0 of a 3D sample, LION being channels-first);data_range: the range of the image values (e.g. 1 for images in [0, 1]); None: each target’s (max - min).