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.
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
Add early stopping utils #1545
Add early stopping utils #1545
Changes from 5 commits
7325b16
f3e5488
1017aa5
da9319e
ae0aea1
0b08247
825f50a
90bbcd8
3e0f152
4b2c690
09aa3da
fc2c7f6
a75e56d
af452c6
6d01f0e
3cf0086
c03a837
6100671
4104aef
e907f82
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We might want to have a way to pass
f
some args. We also don't want to have to callf()
twice here.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.
The second call only happens when the closure is called? This call only happens once to initialize
best_score
. Since the correct initial value will depend onf
anddelta
, maybe it would be better to passbest_score
in as a keyword argument. The default can bef()
.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.
Also, what args were you thinking of passing to
f
? The only additional variables introduced into the scope arepatience
andbest_score
. Just trying to understand how the additional args might be used.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.
Well the closure would be called frequently. Optimising here makes sense.
I was referring to passing arguments to
f
- be that the loss function or for delayed evaluation etc. Having the general case here is nicer.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.
Oh are you saying something like
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.
That's a good idea. Should we just make it args + kwargs?
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.
Yeah but you need the updated score from
f
. What would you optimize out? Could you share a snippet of what you mean? I am just confused what you want to eliminate.