-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Remove NaNs from loss in LRFinder #1862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I wouldn't know how to test this however. Which kind of models have this behaviour?
Let's also add a changelog entry?
notifiying also @SkafteNicki |
Do simple run, run the suggestion algorithm, introduce a nan artificially, recompute suggestion. If this works the two suggestions should be the same. |
just a note for speed, could we do the filtering in PyTorch not converting to NumPy? |
@Borda the values are stored as a list (of floats), so i guess that the penalty of converting to numpy vs pytorch is small |
the conversion is at the full end of the lr finder and before training begins no? |
Is this ready? |
I will add the test case now. |
This pull request is now in conflict... :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SkafteNicki
https://github.com/rohitgr7/pytorch-lightning/blob/fix_lr_finder/pytorch_lightning/trainer/lr_finder.py#L383 still introduces gpu_syncs. Could the same behavior be achieved with tensors as well to avoid gpu-syncs? (can probably be neglected, just asking, while we're on it :))
Otherwise this looks fine to me :)
Before submitting
What does this PR do?
Fixes #1850.
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃