988ee51b15466231e9770f46dcb4d221866322a7,OpenNMT/train.py,,main,#,263
Before Change
print("Loading model from checkpoint at %s" % opt.train_from)
model.load_state_dict(checkpoint["model"])
generator.load_state_dict(checkpoint["generator"])
optim = checkpoint["optim"]
opt.start_epoch = checkpoint["epoch"] + 1
if len(opt.gpus) >= 1:
model.cuda()
After Change
if opt.train_from:
optim.last_ppl = checkpoint["last_ppl"]
optim.optimizer.load_state_dict(checkpoint["optimizer"])
nParams = sum([p.nelement() for p in model.parameters()])
print("* number of parameters: %d" % nParams)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: pytorch/examples
Commit Name: 988ee51b15466231e9770f46dcb4d221866322a7
Time: 2017-03-14
Author: bryan.mccann.is@gmail.com
File Name: OpenNMT/train.py
Class Name:
Method Name: main
Project Name: kevinzakka/recurrent-visual-attention
Commit Name: b659b6ff06561d073320b8123811ee738f968d9f
Time: 2018-03-29
Author: kevinarmandzakka@gmail.com
File Name: trainer.py
Class Name: Trainer
Method Name: load_checkpoint
Project Name: pytorch/examples
Commit Name: fcaf4c22bafc28d7ff0a31cd18a75f81737892c6
Time: 2017-03-14
Author: bryan.mccann.is@gmail.com
File Name: OpenNMT/train.py
Class Name:
Method Name: main