1my_callbacks = [
2 tf.keras.callbacks.EarlyStopping(patience=2),
3 tf.keras.callbacks.ModelCheckpoint(filepath='model.{epoch:02d}-{val_loss:.2f}.h5'),
4 tf.keras.callbacks.TensorBoard(log_dir='./logs'),
5]
6model.fit(dataset, epochs=10, callbacks=my_callbacks)
7