How to save the best model checkpoi through the epochs of a deep learning network through callbacks?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 07:30 AM
I have create a neural network and I am training the model with the code as below. The code fails to write to the databricks file storage. is there any other way to write the checkpoint to databricks storage or to an s3 bucket directly?
custom_early_stopping = EarlyStopping(
monitor='val_loss',
patience=100,
)
best_model_checkpoint = ModelCheckpoint('local location in databricks file storge', save_best_only=True, monitor='val_loss', mode='min')
# Fit the model
history = model.fit(
x = [inputs],
y = y,
batch_size= 10,
epochs = 2,
verbose=1,
shuffle =False,
validation_split=0.2,
callbacks=[custom_early_stopping, best_model_checkpoint]