Skip to content

Commit 8156353

Browse files
authored
Update transfer_learning.ipynb - fix initial_epoch for fine tuning
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)
1 parent fa06aee commit 8156353

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/en/tutorials/images/transfer_learning.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@
930930
"\n",
931931
"history_fine = model.fit(train_dataset,\n",
932932
" epochs=total_epochs,\n",
933-
" initial_epoch=history.epoch[-1],\n",
933+
" initial_epoch=history.epoch[-1]+1,\n",
934934
" validation_data=validation_dataset)"
935935
]
936936
},

0 commit comments

Comments
 (0)