Skip to content

Commit

Permalink
Update transfer_learning.ipynb - fix initial_epoch for fine tuning
Browse files Browse the repository at this point in the history
initial_epoch for the fine tuning phase should be 1 more than history.epoch[-1], so that the history_fine.epoch would be [10, 11, ...19], a total of 10 fine tune epochs.
Without the '+1', history.epoch is [0, 1, ...9], and history_fine.epoch is [9, 10, ... 19], the epoch index overlaps at 9, fine tune actually trained for 11 epochs, not 10, and the model is actually trained for 21 epochs in total (confirmed in the x axis of the combined training history curve - 21 data points)
  • Loading branch information
sharkfisher authored Dec 18, 2023
1 parent fa06aee commit 8156353
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/en/tutorials/images/transfer_learning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@
"\n",
"history_fine = model.fit(train_dataset,\n",
" epochs=total_epochs,\n",
" initial_epoch=history.epoch[-1],\n",
" initial_epoch=history.epoch[-1]+1,\n",
" validation_data=validation_dataset)"
]
},
Expand Down

0 comments on commit 8156353

Please sign in to comment.