-
Notifications
You must be signed in to change notification settings - Fork 777
Use Jax RNG for data shuffling in MNIST example. #296
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
PiperOrigin-RevId: 313495186
Codecov Report
@@ Coverage Diff @@
## master #296 +/- ##
=======================================
Coverage 79.33% 79.33%
=======================================
Files 34 34
Lines 2255 2255
=======================================
Hits 1789 1789
Misses 466 466 Continue to review full report at Codecov.
|
howtos/diffs/checkpointing.diff
Outdated
| + checkpoints.save_checkpoint(FLAGS.model_dir, optimizer, epoch, keep=3) | ||
| + | ||
| + | ||
| + # Save model at every epoch |
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.
Is this correct? The indentation look to have changed -- doesn't this now only save the model at the end of training?
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.
Yes, that sounds right; fixed.
| - loss, accuracy = eval_model(optimizer.target, test_ds) | ||
| + model = jax_utils.unreplicate(optimizer.target) # Fetch from 1st device | ||
| + loss, accuracy = eval_model(model, test_ds) | ||
| + loss_accuracy = eval_model(model, test_ds) |
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.
Is this correct? Seem like a typo maybe? (Do HOWTO tests pass here? -- looks like yes, but maybe the tests don't yet cover this step?)
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.
Yes, this is a typo! The test tests train_step, but not train.
This PR contains commit history from #293 and fixes up
howtos.