Skip to content

[MRG] update impostors, closer to original implem #228

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

Merged
merged 14 commits into from
Jul 4, 2019

Conversation

wdevazelhes
Copy link
Member

@wdevazelhes wdevazelhes commented Jul 2, 2019

This is another attempt to update impostors in LMNN (like #223), closer to the original implementation

@wdevazelhes
Copy link
Member Author

wdevazelhes commented Jul 2, 2019

It now works on my machine, so I guess the only thing needed is a bit of refactoring, but at first sight, what do you think @bellet @perimosocordiae ?

@wdevazelhes
Copy link
Member Author

Also, the test example does not have a decreasing number of active constraints. I'll try to find an example where it's the case, also where the original impostors are not the ones at the end. This way, everything will be properly tested.

@wdevazelhes
Copy link
Member Author

So I tried on another example (more features, and more noise, to be more like what we saw in #208 , that is to say distances between points don't separate them well at first) where the number of active constraints diminishes, and it does not work anymore (the values are still similar but not exactly the same). I'll try to find why.
I'll re-read the modifications I did, and also try to look at the gradient, see if it suddenly differs at some point and why...

@bellet
Copy link
Member

bellet commented Jul 3, 2019

Looks fine at first sight

@wdevazelhes
Copy link
Member Author

I just added the more robust test where the number of impostors varies and it fails this time on my machine (at iteration 21, the gradient is quite different, I checked if it could be some accumulated uncertainties somewhere but it does not seem so, since the gradient is exactly equal at iteration 20...) I'll check what's happening

@bellet bellet mentioned this pull request Jul 3, 2019
@bellet
Copy link
Member

bellet commented Jul 3, 2019

Did you check if this improves the results on the doc example?

Overall i think not updating the impostors was problematic and not consistent with the specifications of the algorithm. We can probably improve the efficiency later but i am for merging this now (if the tests pass)

@wdevazelhes
Copy link
Member Author

Yes, it improves the result, but this time at the condition to not set the init (i.e. not set it to 'random', as before). Setting to random barely changes wrt the original image. I'll remove it in this PR. Here is the result:

image

@wdevazelhes wdevazelhes changed the title [WIP] update impostors, closer to original implem [MRG] update impostors, closer to original implem Jul 3, 2019
@wdevazelhes
Copy link
Member Author

CI tests are green we can merge when we're ready

@wdevazelhes
Copy link
Member Author

Let's merge this and maybe if needed later we can make changes

@wdevazelhes wdevazelhes merged commit 09dcd56 into scikit-learn-contrib:master Jul 4, 2019
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