Skip to content

Instantly share code, notes, and snippets.

@Tob-iee
Created February 7, 2024 10:14
Show Gist options
  • Save Tob-iee/3d746e11eabe69369129a0e5c9d1f76c to your computer and use it in GitHub Desktop.
Save Tob-iee/3d746e11eabe69369129a0e5c9d1f76c to your computer and use it in GitHub Desktop.
model = create_model()
print("\n[INFO] Ready to train. Training is starting!\n")
callback = tf.keras.callbacks.EarlyStopping(monitor='loss', patience=3) # limitation to stop somewhere early
hist = model.fit(train_generator, validation_data=val_generator, epochs=30, callbacks=[callback])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment