Skip to content

Instantly share code, notes, and snippets.

@LysandreJik LysandreJik/keras_fit.py Secret
Created Oct 8, 2019

Embed
What would you like to do?
Training with Keras' fit
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
You can’t perform that action at this time.