79fc09d66d3f4736b9fb4f5756a78725719f3808,train.py,,train,#Any#,27

Before Change



    // Load the optimizer
    if infos.get("state_dict", None):
        optimizer.load_state_dict(infos["state_dict"])

    while True:
        if update_lr_flag:
                // Assign the learning rate

After Change


    optimizer = optim.Adam(model.parameters(), lr=opt.learning_rate)

    // Load the optimizer
    if vars(opt).get("start_from", None) is not None:
        optimizer.load_state_dict(torch.load(os.path.join(opt.start_from, "optimizer.pth")))

    while True:
        if update_lr_flag:
                // Assign the learning rate
            if epoch > opt.learning_rate_decay_start and opt.learning_rate_decay_start >= 0:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: 79fc09d66d3f4736b9fb4f5756a78725719f3808
Time: 2017-02-10
Author: rluo@ttic.edu
File Name: train.py
Class Name:
Method Name: train


Project Name: Microsoft/nni
Commit Name: 6126960c57919dc71237609c76c2d0449834c24c
Time: 2020-10-10
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: examples/model_compress/amc/amc_train.py
Class Name:
Method Name: get_model