7fffa98b9166a03b4a53fb40202d97b09e8e9036,train.py,,,#,21

Before Change


        targets = Variable(targets.type(Tensor), requires_grad=False)
        optimizer.zero_grad()

        loss = model(imgs, targets)

        loss.backward()
        optimizer.step()

After Change


// Get hyper parameters
hyperparams     = parse_model_config(opt.model_config_path)[0]
batch_size      = int(hyperparams["batch"])
subdivisions    = int(hyperparams["subdivisions"])
sub_batch       = batch_size // subdivisions
learning_rate   = float(hyperparams["learning_rate"])
momentum        = float(hyperparams["momentum"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: 7fffa98b9166a03b4a53fb40202d97b09e8e9036
Time: 2018-05-29
Author: eriklindernoren@gmail.com
File Name: train.py
Class Name:
Method Name:


Project Name: leftthomas/SRGAN
Commit Name: 14c0cf773f514788aca6b935298fa186890eecc1
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: ca7a5e9a39478054dbdfbfba9963b13c80b768f8
Time: 2018-03-14
Author: max.lapan@gmail.com
File Name: ch18/telegram-bot.py
Class Name: Session
Method Name: move_bot


Project Name: kevinzakka/recurrent-visual-attention
Commit Name: f466871be6ee80533c997cf6c958aa41a697936f
Time: 2018-01-22
Author: kevinarmandzakka@gmail.com
File Name: trainer.py
Class Name: Trainer
Method Name: train_one_epoch