-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Be more clear about train_step and test_step #1969
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
Conversation
Be more clear that the train_step and test_step are also moved to the accelerator. This was not clear before. This makes it explicit, which should help people understanding TPU efficiency.
PreviewPreview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.Format and styleUse the TensorFlow docs notebook tools to format for consistent source diffs and lint for style:$ python3 -m pip install -U --user git+https://github.com/tensorflow/docsIf commits are added to the pull request, synchronize your local branch: git pull origin patch-1
|
@rchao Can you PTAL? Thanks! |
@@ -508,7 +508,7 @@ | |||
"Here's what you need to change in your code:\n", | |||
"\n", | |||
"1. Create an instance of the appropriate `tf.distribute.Strategy`.\n", | |||
"2. Move the creation of Keras model, optimizer and metrics inside `strategy.scope`.\n", | |||
"2. Move the creation of Keras model, optimizer and metrics inside `strategy.scope`. Thus the code in the model's run(), train_step(), and test_step() will all be distributed and executed on the accelerator(s).\n", |
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.
I'm not sure what "model's run()" refers to. Also, please backtick the symbols. Thanks!
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.
Done. Made the references explicit by describing them as methods.
(Let me know if I need to be even more explicit.)
Thanks for the suggestion.
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.
Thanks! train_step()
and test_step()
make sense to me, but I'm not sure what run()
refers to because there is not such run()
method of a Keras model.
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.
Oops, I should have said call method (not run). Sorry for the tardy response... I had to look up the right terminology.
Made the references to the run, train_step and test_step methods more clear. [Do I need to be more explicit that the Keras model is a (sub) class and it does the work with the run, train_step and test_step methods, all of which might be subclassed for a specific model implementation?]
Ping? Is the update (using the proper terminology) still pending? I think I have pushed everything correctly... |
Hi, thanks for the ping. I'll see if I can get this merged. |
Be more clear that the train_step and test_step are also moved to the accelerator. This was not clear before. This makes it explicit, which should help people understanding TPU efficiency.