-
Notifications
You must be signed in to change notification settings - Fork 488
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
New callbacks API #607
Merged
Merged
New callbacks API #607
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shaydeci
requested changes
Jan 12, 2023
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.
Nice! especially on the docs work, really appreciated.
I got some comments/suggestions inline.
shaydeci
approved these changes
Jan 16, 2023
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.
LGTM
Louis-Dupont
pushed a commit
that referenced
this pull request
Jan 17, 2023
* New callbacks API * New callbacks API * New callbacks API * Fix imports * Uncomment sanity check * Fix callbacks order * Fix callbacks order * Fix callbacks order * Fix wrong import * Fix wrong import * Call update_context * Call update_context * Fix on_train_batch_start timing * Added docs clarifying mapping of new events to old Phase enum values * Instantiate context after _prep_for_test Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com>
Louis-Dupont
added a commit
that referenced
this pull request
Jan 19, 2023
* change requirements.txt * try to fix version * add version * test 1.13.5 * New callbacks API (#607) * New callbacks API * New callbacks API * New callbacks API * Fix imports * Uncomment sanity check * Fix callbacks order * Fix callbacks order * Fix callbacks order * Fix wrong import * Fix wrong import * Call update_context * Call update_context * Fix on_train_batch_start timing * Added docs clarifying mapping of new events to old Phase enum values * Instantiate context after _prep_for_test Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com> * first version (#626) Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com> * Improve env sanity check to be more robust (#612) * first version - a few things to change * improve * imrpove doc * undo requirements change * mini update * support wildcards and improve code * move all to same file, and only raise error when version too small * move all to same file, and only raise error when version too small * remove arg * 1.13.* * catch warning and fix requirement * remove catching * warning * try 1.14 to pass security check * replace <=1.13 to <1.14 Co-authored-by: Eugene Khvedchenya <ekhvedchenya@gmail.com> Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com> Co-authored-by: Ofri Masad <ofrimasad@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduce a new intermediate class
Callback
thatPhaseCallback
derive from. This way we keep backward compatibility with existing callbacks, while gaining the ability to implement callbacks that needs access to more than one event. Many hard-coded logic pieces in Trainer class can be reimplemented as callbacks (Logging, EMA, LR Warmups, QAT).