2c757bdbd35f07b2bb44cd21ff9124ccf008fe1e,classification/train_classifier.py,,eval_model,#,64

Before Change


        return self.out(output)

def eval_model(niter, model, valid_x, valid_y):
    model.eval()
    N = len(valid_x)
    criterion = nn.CrossEntropyLoss()
    correct = 0.0
    cnt = 0

After Change



def eval_model(niter, model, valid_x, valid_y):
    with torch.no_grad():
        model.eval()
        N = len(valid_x)
        criterion = nn.CrossEntropyLoss()
        correct = 0.0
        cnt = 0
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: asappresearch/sru
Commit Name: 2c757bdbd35f07b2bb44cd21ff9124ccf008fe1e
Time: 2019-10-22
Author: tao@asapp.com
File Name: classification/train_classifier.py
Class Name:
Method Name: eval_model


Project Name: asappresearch/sru
Commit Name: 5527c532288b90c6a52c3bab08a2832984d2d96c
Time: 2019-10-22
Author: tao@asapp.com
File Name: classification/train_classifier.py
Class Name:
Method Name: eval_model


Project Name: NTMC-Community/MatchZoo
Commit Name: b95b76b5b3b8cc18d60d09541e521bffead1a999
Time: 2019-04-18
Author: chenjiangui@outlook.com
File Name: tests/unit_test/test_layers.py
Class Name:
Method Name: test_matching_tensor_layer