376b01c2e338ec63e638f62a76d67f6a9323e47c,code/deep/DeepCoral/DeepCoral.py,,,#,109
Before Change
print(model)
if cuda:
model.cuda()
model = load_pretrain(model)
for epoch in range(1, epochs + 1):
train(epoch, model)
t_correct = test(model)
if t_correct > correct:
correct = t_correct
print("source: {} to target: {} max correct: {} max accuracy{: .2f}%\n".format(
source_name, target_name, correct, 100. * correct / len_target_dataset ))
After Change
optimizer = torch.optim.SGD([
{"params": model.sharedNet.parameters()},
{"params": model.fc.parameters()},
{"params": model.cls_fc.parameters(), "lr": 10 * CFG["lr"]},
], lr=CFG["lr"], momentum=CFG["momentum"], weight_decay=CFG["l2_decay"])
train(source_loader, target_train_loader, target_test_loader, model, optimizer, CFG)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: jindongwang/transferlearning
Commit Name: 376b01c2e338ec63e638f62a76d67f6a9323e47c
Time: 2019-08-14
Author: jindongwang@outlook.com
File Name: code/deep/DeepCoral/DeepCoral.py
Class Name:
Method Name:
Project Name: data61/python-paillier
Commit Name: 1bcbc90debe300740369b1151b3f1b8523289f91
Time: 2018-06-26
Author: wilko.henecka@data61.csiro.au
File Name: examples/federated_learning_with_encryption.py
Class Name:
Method Name: federated_learning
Project Name: cve-search/cve-search
Commit Name: 412e06fce467da87161cb535ba25c4234a0c3712
Time: 2014-10-02
Author: pieterjan.moreels@gmail.com
File Name: db_whitelist.py
Class Name:
Method Name: