cd80a074396caa42b81068115c9b066f4ce08414,train_img_model_cent.py,,train,#Any#Any#Any#Any#Any#Any#Any#,193
Before Change
for batch_idx, (imgs, pids, _) in enumerate(trainloader):
if use_gpu:
imgs, pids = imgs.cuda(), pids.cuda()
imgs, pids = Variable(imgs), Variable(pids)
outputs, features = model(imgs)
xentloss = criterion_xent(outputs, pids)
centloss = criterion_cent(features, pids) * args.weight_cent
loss = xentloss + centloss
After Change
for param in criterion_cent.parameters():
param.grad.data *= (1. / args.weight_cent)
optimizer_cent.step()
losses.update(loss.item(), pids.size(0))
if (batch_idx+1) % args.print_freq == 0:
print("Batch {}/{}\t Loss {:.6f} ({:.6f})".format(batch_idx+1, len(trainloader), losses.val, losses.avg))
In pattern: SUPERPATTERN
Frequency: 6
Non-data size: 6
Instances
Project Name: KaiyangZhou/deep-person-reid
Commit Name: cd80a074396caa42b81068115c9b066f4ce08414
Time: 2018-04-26
Author: k.zhou@qmul.ac.uk
File Name: train_img_model_cent.py
Class Name:
Method Name: train
Project Name: KaiyangZhou/deep-person-reid
Commit Name: cd80a074396caa42b81068115c9b066f4ce08414
Time: 2018-04-26
Author: k.zhou@qmul.ac.uk
File Name: train_img_model_xent_htri.py
Class Name:
Method Name: train
Project Name: KaiyangZhou/deep-person-reid
Commit Name: cd80a074396caa42b81068115c9b066f4ce08414
Time: 2018-04-26
Author: k.zhou@qmul.ac.uk
File Name: train_vid_model_xent_htri.py
Class Name:
Method Name: train
Project Name: KaiyangZhou/deep-person-reid
Commit Name: cd80a074396caa42b81068115c9b066f4ce08414
Time: 2018-04-26
Author: k.zhou@qmul.ac.uk
File Name: train_vid_model_xent.py
Class Name:
Method Name: train
Project Name: zhirongw/lemniscate.pytorch
Commit Name: 4441480fde64e42a9c4af205bf2ab8003511172e
Time: 2018-07-26
Author: xavibrowu@gmail.com
File Name: cifar.py
Class Name:
Method Name: train
Project Name: KaiyangZhou/deep-person-reid
Commit Name: cd80a074396caa42b81068115c9b066f4ce08414
Time: 2018-04-26
Author: k.zhou@qmul.ac.uk
File Name: train_img_model_xent.py
Class Name:
Method Name: train
Project Name: KaiyangZhou/deep-person-reid
Commit Name: cd80a074396caa42b81068115c9b066f4ce08414
Time: 2018-04-26
Author: k.zhou@qmul.ac.uk
File Name: train_img_model_cent.py
Class Name:
Method Name: train