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

fix: Apply scale parameter within exp in MultiScaleKernel #40

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

Markus28
Copy link
Contributor

It appears that there is a typo in the implementation of MultiScaleKernel. Namely, @pjhartout and I would expect that the scale parameter self.sigma should be applied before exponentiation in these two lines:

M = torch.exp(-nom) / (8 * self.sigma)

M -= torch.exp(-denom) / (8 * self.sigma)

For reference, consider equation 10 in https://arxiv.org/pdf/1412.6821.
In the current implementation, self.sigma only acts as a multiplicative factor on the kernel and thereby does not meaningfully change its behavior.

This PR fixes the two lines above. The tests are passing locally for me.

@Pseudomanifold Pseudomanifold self-assigned this Aug 22, 2024
Copy link
Contributor

@Pseudomanifold Pseudomanifold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me, thanks for your contribution!

@Pseudomanifold Pseudomanifold merged commit fa2017c into aidos-lab:main Aug 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants