Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions train.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ for i = start_i + 1, num_iterations do
memory_usage = memory_usage,
i = i
}
local filename = string.format('%s_%d.json', opt.checkpoint_name, i)
local filename = string.format('%s_%d_epoch%.2f_%.4f.json', opt.checkpoint_name, i, epoch, val_loss)
-- Make sure the output directory exists before we try to write it
paths.mkdir(paths.dirname(filename))
utils.write_json(filename, checkpoint)
Expand All @@ -237,7 +237,7 @@ for i = start_i + 1, num_iterations do
model:clearState()
model:float()
checkpoint.model = model
local filename = string.format('%s_%d.t7', opt.checkpoint_name, i)
local filename = string.format('%s_%d_epoch%.2f_$.4f.t7', opt.checkpoint_name, i, epoch, val_loss)
paths.mkdir(paths.dirname(filename))
torch.save(filename, checkpoint)
model:type(dtype)
Expand Down