Last active
April 16, 2023 14:53
-
-
Save doleron/4105949067377043dc21f9b037d06ebb to your computer and use it in GitHub Desktop.
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
EPOCHS = 200 | |
model.compile(loss=contrastive_loss_with_margin(margin=1), optimizer=tf.keras.optimizers.RMSprop(), | |
metrics=[Custom_Accuracy(), Custom_Precision(), Custom_Recall()]) | |
early_stop = tf.keras.callbacks.EarlyStopping(monitor='val_loss', patience = 30, start_from_epoch = 10) | |
checkpoint = tf.keras.callbacks.ModelCheckpoint(model_file, monitor="val_loss", mode="min", save_best_only=True, verbose=1) | |
history = model.fit(train_ds, | |
steps_per_epoch=(len(training_pairs) // TRAINING_BATCH_SIZE), | |
validation_data=validation_ds, | |
epochs=EPOCHS, | |
callbacks=[early_stop, checkpoint]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment