e6b394f7340cbeee16bf4424cdf0367f80b60619,code/deep/finetune_AlexNet_ResNet/office31.py,,,#,112
Before Change
torch.manual_seed(10)
root_dir = "data/OFFICE31/"
src, tar = "amazon", "webcam"
model_name = "alexnet"
data_src, data_tar = data_loader.load_training(root_dir, src, BATCH_SIZE_SRC), \
data_loader.load_testing(root_dir, tar, BATCH_SIZE_TAR)
print("Source:{}, target:{}".format(src, tar))
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)
test(e, model, data_tar)
lrs = lr_decay(1e-4, N_EPOCH, e)
After Change
// 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))
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
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: Qiskit/qiskit-aqua
Commit Name: f3a426f88da4760895a42751b1fe668fee3a834f
Time: 2018-08-31
Author: chenrich@us.ibm.com
File Name: qiskit_aqua/algorithms/classical/svm/svm_classical_multiclass.py
Class Name: SVM_Classical_Multiclass
Method Name: run
Project Name: osmr/imgclsmob
Commit Name: ea65d92a41ba1e8171cd0814dc9c50373f8e2c4f
Time: 2020-01-16
Author: osemery@gmail.com
File Name: eval_ch.py
Class Name:
Method Name: main
Project Name: pytorch/text
Commit Name: 11b030dadd33dc13f21e214d7bab6e0c9434f9e0
Time: 2019-07-26
Author: cpuhrsch@fb.com
File Name: examples/text_classification/train.py
Class Name:
Method Name: