27a6244452c5fcc2269dc59e26a50a4599771081,imagenet/main.py,,train,#,259

Before Change


        end = time.time()

        if i % args.print_freq == 0:
            print("Epoch: [{0}][{1}/{2}]\t"
                  "Time {batch_time.val:.3f} ({batch_time.avg:.3f})\t"
                  "Data {data_time.val:.3f} ({data_time.avg:.3f})\t"
                  "Loss {loss.val:.4f} ({loss.avg:.4f})\t"
                  "Acc@1 {top1.val:.3f} ({top1.avg:.3f})\t"
                  "Acc@5 {top5.val:.3f} ({top5.avg:.3f})".format(
                   epoch, i, len(train_loader), batch_time=batch_time,
                   data_time=data_time, loss=losses, top1=top1, top5=top5))


def validate(val_loader, model, criterion, args):
    batch_time = AverageMeter()

After Change



def train(train_loader, model, criterion, optimizer, epoch, args):
    batch_time = AverageMeter("Time", ":6.3f")
    data_time = AverageMeter("Data", ":6.3f")
    losses = AverageMeter("Loss", ":.4e")
    top1 = AverageMeter("Acc@1", ":6.2f")
    top5 = AverageMeter("Acc@5", ":6.2f")
    progress = ProgressMeter(len(train_loader), batch_time, data_time, losses, top1,
                             top5, prefix="Epoch: [{}]".format(epoch))

    // switch to train mode
    model.train()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pytorch/examples
Commit Name: 27a6244452c5fcc2269dc59e26a50a4599771081
Time: 2019-03-27
Author: gamesnmore@online.de
File Name: imagenet/main.py
Class Name:
Method Name: train


Project Name: suragnair/alpha-zero-general
Commit Name: 9a162c34649aae4c37391c85e75f1de297f98712
Time: 2017-12-03
Author: suragnair@hotmail.com
File Name: Coach.py
Class Name: Coach
Method Name: learn


Project Name: pytorch/examples
Commit Name: 27a6244452c5fcc2269dc59e26a50a4599771081
Time: 2019-03-27
Author: gamesnmore@online.de
File Name: imagenet/main.py
Class Name:
Method Name: validate