Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #208 (comment)
This fixes the TODO at top of LMNN: it recomputes the impostors at each step
This is a WIP and not tested for now (though it works on a small example but it's not efficient at all, more like a first atempt to do that with very few code change)
Note that in the scikit-learn PR, they do update the impostors scikit-learn/scikit-learn#8602, but they only keep a maximum number of impostors
We also need to decide whether we want impostors updating to be an option or to be always there
Note: for now, I update the impostors, but it's not at all efficient, because the distances comparisons are re-done just after, when computing the active constraints. The advantage of computing impostors is to search for active constraints only amongst them. An idea could be to do the following (I've not thought of it all the way through so it might be wrong):
etc
Note: a quick solution that could be used as a first improvement (and the real improvement would be in V0.6.0) would be to have an option to either use the impostors computed at the beginning, or to use all impostors possible (i.e. all pairs of points of different labels) (which can very easily be implemented in the
find_impostors
function