42fc102b56aadde323fa695d35e109c5bfb13e7c,evaluate.py,,,#,15
Before Change
if not isinstance(batch[key], list):
batch[key] = Variable(batch[key].cuda(), volatile=True)
enc_out = encoder(batch["img_feat"], batch["ques_fwd"], batch["hist"])
dec_out = decoder(enc_out, batch["opt"])
scores = dec_out.data
gt_pos = batch["ans_ind"].data.view(-1, 1)
gt_score = scores.gather(1, gt_pos)
ranks = scores.gt(gt_score.expand_as(scores))
all_ranks.append(ranks.sum(1) + 1)
After Change
if not isinstance(batch[key], list):
batch[key] = Variable(batch[key].cuda(), volatile=True)
enc_out = encoder(batch)
scores = decoder(enc_out, batch).data
gt_pos = batch["ans_ind"].data.view(-1, 1)
gt_score = scores.gather(1, gt_pos)
ranks = scores.gt(gt_score.expand_as(scores))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: batra-mlp-lab/visdial-challenge-starter-pytorch
Commit Name: 42fc102b56aadde323fa695d35e109c5bfb13e7c
Time: 2018-07-08
Author: karandesai281196@gmail.com
File Name: evaluate.py
Class Name:
Method Name:
Project Name: batra-mlp-lab/visdial-challenge-starter-pytorch
Commit Name: f6415170f7f90124e9cdb9ccd37cd867852b7657
Time: 2018-07-08
Author: karandesai281196@gmail.com
File Name: evaluate.py
Class Name:
Method Name:
Project Name: asyml/texar
Commit Name: c8523b2dc735a1b82ca6170e6ca349defe9f77fc
Time: 2017-11-17
Author: shore@pku.edu.cn
File Name: examples/transformer.py
Class Name:
Method Name: