Skip to content

Commit 1def963

Browse files
author
Matt Jones
committed
Allow a new maxepoch when resuming from a checkpoint.
1 parent 501d29c commit 1def963

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

train.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ if plpath.isfile(lastStatePath) and not config.nosave then
396396
state.epoch, state.t, state.epoch_t, state.jumped))
397397
end
398398
end
399+
400+
-- Support modifying the maxepoch setting during resume
401+
engine.hooks.onResume = function(state)
402+
state.maxepoch = config.maxepoch
403+
end
404+
399405
engine:resume{
400406
path = lastStatePath,
401407
iterator = corpus.train,

0 commit comments

Comments
 (0)