e6b394f7340cbeee16bf4424cdf0367f80b60619,code/deep/finetune_AlexNet_ResNet/office31.py,,,#,112

Before Change



    model = load_model(model_name).to(DEVICE)
    lrs = LEARNING_RATE
    for e in tqdm(range(1, N_EPOCH + 1)):
        tqdm.write("learning rate: " + str(lrs))
        optimizer = get_optimizer(model_name,learning_rate=lrs)
        train(e, model, optimizer, data_src)

After Change


    torch.manual_seed(10)
    // Load data
    root_dir = "data/OFFICE31/"
    domain = {"src": "amazon", "tar": "webcam"}
    dataloaders = {x: data_loader.load_data(root_dir, domain[x], BATCH_SIZE[x], x) for x in ["src", "tar"]}
    // Load model
    model_name = str(args.model)
    model = load_model(model_name).to(DEVICE)
    print("Source:{}, target:{}, model: {}".format(domain["src"], domain["tar"], model_name))
    optimizer = get_optimizer(model_name)
    model_best, best_acc, acc_hist = finetune(model, dataloaders, optimizer)
    print("{}Best acc: {}".format("*" * 10, best_acc))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: jindongwang/transferlearning
Commit Name: e6b394f7340cbeee16bf4424cdf0367f80b60619
Time: 2018-12-22
Author: jindongwang@outlook.com
File Name: code/deep/finetune_AlexNet_ResNet/office31.py
Class Name:
Method Name:


Project Name: r9y9/wavenet_vocoder
Commit Name: 7743664b2b960693abd88433b8e5060fa358187f
Time: 2018-01-04
Author: zryuichi@gmail.com
File Name: evaluate.py
Class Name:
Method Name:


Project Name: facebookresearch/ParlAI
Commit Name: b167c6262c6614c7e13104bf3755d637d621c1f0
Time: 2018-10-05
Author: kulikov@cs.nyu.edu
File Name: parlai/scripts/convert_data_to_parlai_format.py
Class Name:
Method Name: dump_data