87b7e56093996e908d310ccd852e7df0a88f2f19,example/main.py,,train,#Any#Any#Any#Any#Any#Any#,164
Before Change
output = model(input)
if type(output) == list: // multiple output
loss = criterion(output[0], target)
for j in range(1, len(output)):
loss += criterion(output[j], target)
output = output[0]
else: // single output
loss = criterion(output, target)
acc = accuracy(output, target, idx)
After Change
data_time.update(time.time() - end)
input, target = input.to(device), target.to(device, non_blocking=True)
target_weight = meta["target_weight"].to(device, non_blocking=True)
// compute output
output = model(input)
if type(output) == list: // multiple output
loss = 0
for o in output:
loss += criterion(o, target, target_weight)
output = output[-1]
else: // single output
loss = criterion(output, target, target_weight)
acc = accuracy(output, target, idx)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: bearpaw/pytorch-pose
Commit Name: 87b7e56093996e908d310ccd852e7df0a88f2f19
Time: 2019-02-25
Author: platero.yang@gmail.com
File Name: example/main.py
Class Name:
Method Name: train
Project Name: hunkim/PyTorchZeroToAll
Commit Name: 55b880469ced115de9949d5d25ff835dabbb2caa
Time: 2017-11-08
Author: hunkim@gmail.com
File Name: 12_2_hello_rnn.py
Class Name:
Method Name:
Project Name: mittagessen/kraken
Commit Name: ac1a7da11afb1a1dd76900d12a07ed4497759d3e
Time: 2018-08-02
Author: mittagessen@l.unchti.me
File Name: kraken/ketos.py
Class Name:
Method Name: train