Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSIM non-rectangular kernel size #306

Open
Willtl opened this issue Mar 2, 2022 · 3 comments
Open

SSIM non-rectangular kernel size #306

Willtl opened this issue Mar 2, 2022 · 3 comments
Labels
feature New feature or request

Comments

@Willtl
Copy link

Willtl commented Mar 2, 2022

Is it possible to use SSIM for sequences without reshaping them? For example, through a [1, 1, 1, 11] kernel size instead of a [1, 1, 11, 11]?

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 rectangles (the length is a perfect square number), it gives me better results. I wonder if it would be possible to apply SSIM (without the requirement of reshaping the sequences) through the use of a non-square window.

In this case, parameter kernel_size could take a tuple of two ints – in which case, the first int is used for the height dimension and the second int for the width dimension

@Willtl Willtl added the feature New feature or request label Mar 2, 2022
@Willtl Willtl changed the title Non-rectangular kernel size SSIM non-rectangular kernel size Mar 2, 2022
@zakajd
Copy link
Collaborator

zakajd commented Mar 2, 2022

Hi @Willtl thanks for a proposal!
Yes, your idea seems valid. I'll discuss this refactoring with development team and respond later this week 👍🏼

Alternative solution will be to pass kernels as matrixes to functional interface of SSIM and other metrics. This will also solve #227 and avoid creation of kernels in class interfaces each time. But this kind of refactoring requires much more effort and can't be done quickly

@Willtl
Copy link
Author

Willtl commented Mar 21, 2022

@zakajd is there any chance I can test my code with the non-rectangular kernel before the end of this month? I have a deadline for submission on the 30th of March.

@zakajd
Copy link
Collaborator

zakajd commented Mar 21, 2022

@Willtl
Me and other guys are currently busy with other PRs, so can’t promise that.

You can fork and implement this by yourself by modifying gaussian kernel function and opening PR

@zakajd zakajd removed their assignment Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants