-
-
Save LysandreJik/b295e94bbb569c7630cf466f998c9b29 to your computer and use it in GitHub Desktop.
Training with Keras' fit
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
optimizer = tf.keras.optimizers.Adam(learning_rate=3e-5, epsilon=1e-08, clipnorm=1.0) | |
loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True) | |
metric = tf.keras.metrics.SparseCategoricalAccuracy('accuracy') | |
bert_model.compile(optimizer=optimizer, loss=loss, metrics=[metric]) | |
bert_history = bert_model.fit( | |
bert_train_dataset, | |
epochs=2, | |
steps_per_epoch=115, | |
validation_data=bert_validation_dataset, | |
validation_steps=7 | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment