Skip to content

Commit

Permalink
Update BackupAndRestore class example (#20714)
Browse files Browse the repository at this point in the history
* Update BackupAndRestore class example

* Update backup_and_restore.py

---------

Co-authored-by: François Chollet <[email protected]>
  • Loading branch information
mehtamansi29 and fchollet authored Jan 2, 2025
1 parent 2c95bfe commit a91d006
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions keras/src/callbacks/backup_and_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class BackupAndRestore(Callback):
>>> callback = keras.callbacks.BackupAndRestore(backup_dir="/tmp/backup")
>>> model = keras.models.Sequential([keras.layers.Dense(10)])
>>> model.compile(keras.optimizers.SGD(), loss='mse')
>>> model.build(input_shape=(None, 20))
>>> try:
... model.fit(np.arange(100).reshape(5, 20), np.zeros(5), epochs=10,
... batch_size=1, callbacks=[callback, InterruptingCallback()],
Expand Down

0 comments on commit a91d006

Please sign in to comment.