8a70c277c355fe734a01fe58baafdc2dc5164205,OpenNMT/train.py,,trainModel,#Any#Any#Any#Any#,134

Before Change


        print("")
        epochState = trainEpoch(epoch, validPpl)
        validPpl = eval(model, criterion, validData)
        print("Validation perplexity. " + validPpl)
        if opt.optim == "sgd":
            optim.updateLearningRate(validPpl, epoch)

        // checkpoint.saveEpoch(validPpl, epochState, not opt.json_log)

After Change


        print("")
        train_loss = trainEpoch(epoch)
        print("Train loss: %g" % train_loss)
        print("Train perplexity: %g" % math.exp(min(train_loss, 100)))
        valid_loss = eval(model, criterion, validData)
        print("Validation perplexity: %g" % math.exp(min(valid_loss, 100)))
        if opt.optim == "sgd":
            optim.updateLearningRate(valid_loss, epoch)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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


Project Name: stanfordnlp/stanza
Commit Name: 386b6077eae995a3bcc87abf1ebaa92a752b3aaa
Time: 2019-09-09
Author: zyh.thu@gmail.com
File Name: stanfordnlp/models/common/train_char_lm.py
Class Name:
Method Name: train_epoch