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

ThinPlateSpline is bugged, proposed fix #896

Open
nikjetchev opened this issue Feb 7, 2018 · 2 comments
Open

ThinPlateSpline is bugged, proposed fix #896

nikjetchev opened this issue Feb 7, 2018 · 2 comments
Milestone

Comments

@nikjetchev
Copy link

nikjetchev commented Feb 7, 2018

Looking at https://github.com/Lasagne/Lasagne/blob/master/lasagne/layers/special.py

function _get_transformed_points_tps

distances = T.switch(T.isnan(log_r_2), r_2 * log_r_2, 0.)

This is a bug -- should be actually T.switch(T.isnan(r_2 * log_r_2), 0., r_2 * log_r_2) because this is the correct order Theano processes switch statement

The fix is very easy -- can somebody make a pull request for this?

@f0k
Copy link
Member

f0k commented Feb 19, 2018

because this is the correct order Theano processes switch statement

Thanks, you're right. It seems this isn't covered by the tests. Did you have a test case that exposed the bug, or did you just notice it while reading the code? (For a PR, we should include a test.)

@f0k f0k added this to the v0.2 milestone Feb 19, 2018
@nikjetchev
Copy link
Author

Hi

I noticed this when playing with the code and copy-pasting parts of it and testing how it works. My usage of the TPS was not the canonical Lasagne usage with layers and objects, so it is not so useful for you.

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

No branches or pull requests

2 participants