Comparing to PSNR, SSIM is defined on the patch level: it considers the structural similarity within each patch.
In practice, it is usually implemented as convolutions where kernels are defined by the pixels in each patch.
We take inspiration from Liu et al. [1]} and follow exactly their partial convolution implementation for this operation, where only the masked pixels are accounted for the final result.
