-
Notifications
You must be signed in to change notification settings - Fork 238
Training Models using Built-in Keras Function #118
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
|
|
||
| def test_step(self, batch): | ||
| x, y_true = batch | ||
| y_pred = self(x, training=True) |
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.
shoud be y_pred = self(x, training=False) ?
`
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.
fixed
| with tf.GradientTape() as tape: | ||
| y_pred = self(x, training=True) | ||
| loss = self.loss(y, y_pred) | ||
| loss = self.loss(y_true, y_pred) |
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.
Pls adding Mixed precision support 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.
loss scaling added, in fact, it doesn't need loss scaling because the loss is already too big at the beginning but I added anyway
(x, y)(x, y)RnntLosssubclass oftf.keras.losses.Lossto use incompilefunction oftf.keras.Modeltrain_stepandtest_stepthat usesRnntLossCtcLosssubclass oftf.keras.losses.Lossto use incompilefunction oftf.keras.Modeltrain_stepandtest_stepthat usesCtcLoss