8000 [MRG+1] Fixes n_iter_without_progress and min_grad_norm in TSNE by ssaeger · Pull Request #6497 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG+1] Fixes n_iter_without_progress and min_grad_norm in TSNE #6497

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

Closed
wants to merge 2 commits into from

Conversation

ssaeger
Copy link
@ssaeger ssaeger commented Mar 6, 2016

Fixes #6450.
The parameters n_iter_without_progress and min_grad_norm are now correctly used and a test was added to ensure that n_iter_without_progress is used correctly.

@AlexanderFabisch
Copy link
Member

Seems to be ok for me. Could you add a test for min_grad_norm as well? The build errors should be unrelated!?

@ssaeger
Copy link
Author
ssaeger commented Mar 21, 2016

The build errors are not related. I will see how I can test min_grad_norm, maybe I have already an idea. :)

@ssaeger
Copy link
Author
ssaeger commented Mar 21, 2016

Ok, I added a test for min_grad_norm.
It checks if the gradient norm values in the verbose output are smaller than min_grad_norm at most once, because if the gradient norm becomes smaller the optimization stops.

@colinmorris
Copy link

Sorry to butt in, but I'm wondering if this P.R. slipped through the cracks, or if there's another reason it hasn't been merged? I just got hit by #6450 myself, and it's pretty hard to work around.

@jnothman
Copy link
Member

Yes, slipped through the cracks. Thanks for resurrecting it.

@jnothman jnothman added the Bug label Sep 15, 2016

# The gradient norm can be smaller than min_grad_norm at most once,
# because in the moment it becomes smaller the optimization stops
assert_less_equal(n_smaller_gradient_norms, 1)
Copy link
Member

Choose a reason for hiding this comment

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

Needs newline at end of file.

@jnothman
Copy link
Member

I'm not loving the text hacking, but as a fix I think this is good.

@jnothman jnothman changed the title [MRG] Fixes n_iter_without_progress and min_grad_norm in TSNE [MRG+1] Fixes n_iter_without_progress and min_grad_norm in TSNE Sep 15, 2016
@jnothman
Copy link
Member

@AlexanderFabisch, could you please review the test for min_grad_norm?

Copy link
Member
@AlexanderFabisch AlexanderFabisch left a comment

Choose a reason for hiding this comment

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

LGTM

sys.stdout = old_stdout

# The output needs to contain the value of n_iter_without_progress
assert("did not make any progress during the "
Copy link
Member

Choose a reason for hiding this comment

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

You can use nose.tools.assert_in

@amueller
Copy link
Member

@colinmorris did this PR fix your issue?

@amueller amueller added this to the 0.18.1 milestone Oct 10, 2016
Copy link
Member
@amueller amueller left a comment

Choose a reason for hiding this comment

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

Looks good to me. Should we merge?

Maximum number of iterations without progress before we abort the
optimization.
optimization. If method='barnes_hut' this parameter is fixed to
Copy link
Member

Choose a reason for hiding this comment

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

This behavior is somewhat peculiar and we could work around it, but let's leave it for now.

@AlexanderFabisch
Copy link
Member

It fixes a bug. So we should merge it. Maybe we should add the newline at the end of the test file.

@jnothman
Copy link
Member

Merged as 2221387. @amueller, I've created a 0.18.1 what's new section, but have not backported this commit to the 0.18.X branch.

@jnothman jnothman closed this Oct 12, 2016
jnothman added a commit that referenced this pull request Oct 12, 2016
amueller added a commit to amueller/scikit-learn that referenced this pull request Oct 14, 2016
# Conflicts:
#	doc/whats_new.rst
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0