68f970aca1f95cddbc1c5fc4e4c7e6b6bffb2293,eval_utils.py,,eval_split,#Any#Any#Any#Any#,59

Before Change


        if data.get("labels", None) is not None and verbose_loss:
            // forward the model to get loss
            tmp = [data["fc_feats"], data["att_feats"], data["labels"], data["masks"], data["att_masks"]]
            tmp = [Variable(torch.from_numpy(_), volatile=True).cuda() for _ in tmp]
            fc_feats, att_feats, labels, masks, att_masks = tmp

            loss = crit(model(fc_feats, att_feats, labels, att_masks), labels[:,1:], masks[:,1:]).data[0]

After Change


        if data.get("labels", None) is not None and verbose_loss:
            // forward the model to get loss
            tmp = [data["fc_feats"], data["att_feats"], data["labels"], data["masks"], data["att_masks"]]
            tmp = [torch.from_numpy(_).cuda() for _ in tmp]
            fc_feats, att_feats, labels, masks, att_masks = tmp

            with torch.no_grad():
                loss = crit(model(fc_feats, att_feats, labels, att_masks), labels[:,1:], masks[:,1:]).item()
            loss_sum = loss_sum + loss
            loss_evals = loss_evals + 1

        // forward the model to also get generated samples for each image
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: 68f970aca1f95cddbc1c5fc4e4c7e6b6bffb2293
Time: 2018-04-26
Author: rluo@ttic.edu
File Name: eval_utils.py
Class Name:
Method Name: eval_split


Project Name: pytorch/examples
Commit Name: 645c7c386e62d2fb1d50f4621c1a52645a13869f
Time: 2018-04-24
Author: soumith@gmail.com
File Name: time_sequence_prediction/train.py
Class Name:
Method Name: