Structural similarity index with a non-rectangular window

Usually, Structural Similarity Index Metric (SSIM) is used for images, through a rectangular window. (Class Interface — PyTorch Image Quality (PIQ) 0.6.0 documentation)

One could use SSIM for sequences just by reshaping the sequence to L x L where L = sqrt(length), such that length is the length of the sequence, and it is a perfect square number, i.e., a sequence of length 100 can be seen as an image 10 x 10.

But is it possible to use SSIM for sequences without reshaping them? For example, through a window 1 x L? Does it even make sense?

The reason I’m asking is that I’m doing self-supervised learning on sequences using 1D CNNs. Surprisingly, when I use SSIM instead of L2, even though I have to reshape the sequences to a rectangle, it gives me better results. I wonder if it would be possible to apply SSIM without the requirement of reshaping the sequences.

@Edit: SSIM non-rectangular kernel size · Issue #306 · photosynthesis-team/piq · GitHub