286a8cb1abde6e030e935734509d7f6832ce0f7f,OpenNMT/train.py,,trainModel,#Any#Any#Any#Any#Any#,154

Before Change




def trainModel(model, trainData, validData, dataset, info):
    params, gradParams = {}, {}

    def initParams(idx, args, state):
        // Only logs information of the first thread.
        verbose = idx == 0 and not opt.json_log

After Change



    for mod in model.values():
        mod.training()
        for p in mod.parameters():
            p.uniform_(-opt.param_init, opt.param_init)

    // define criterion of each GPU
    criterion = onmt.utils.Cuda.convert(buildCriterion(dataset.dicts.tgt.words.size(),
                                                       dataset.dicts.tgt.features))

    optim = onmt.train.Optim(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: pytorch/examples
Commit Name: 286a8cb1abde6e030e935734509d7f6832ce0f7f
Time: 2016-12-23
Author: alerer@fb.com
File Name: OpenNMT/train.py
Class Name:
Method Name: trainModel


Project Name: OpenNMT/OpenNMT-py
Commit Name: 301b0cbf78e3de174a50fff682e142c985b3ae88
Time: 2017-02-22
Author: alerer@fb.com
File Name: OpenNMT/train.py
Class Name:
Method Name: main