cb413bcf7b58223c6c4335f2eaaf3dc53c0b0c53,train.py,,main,#,190
Before Change
device = torch.device("cuda" if opt.cuda else "cpu")
//========= Loading Dataset =========//
data = pickle.load(open(opt.data, "rb"))
opt.max_token_seq_len = data["settings"].max_len
opt.src_pad_idx = data["vocab"]["src"].vocab.stoi[Constants.PAD_WORD]
opt.trg_pad_idx = data["vocab"]["trg"].vocab.stoi[Constants.PAD_WORD]
opt.src_vocab_size = len(data["vocab"]["src"].vocab)
opt.trg_vocab_size = len(data["vocab"]["trg"].vocab)
training_data, validation_data = prepare_dataloaders(data, device, opt.batch_size)
//========= Preparing Model =========//
if opt.embs_share_weight:
After Change
if opt.data_pkl:
training_data, validation_data = prepare_dataloaders(opt, device)
elif all((opt.train_path, opt.val_path)):
training_data, validation_data = prepare_dataloaders_from_bpe_files(opt, device)
else:
raise
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: cb413bcf7b58223c6c4335f2eaaf3dc53c0b0c53
Time: 2019-12-05
Author: jadore801120@gmail.com
File Name: train.py
Class Name:
Method Name: main
Project Name: xinntao/BasicSR
Commit Name: 0134a038d242a57e765de9f7288b974ff72646f0
Time: 2019-06-02
Author: wxt1994@126.com
File Name: codes/data/LRHR_dataset.py
Class Name: LRHRDataset
Method Name: __init__
Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: b25cc3a7e6a560c1fd47f36a43296f62eaaace36
Time: 2019-12-07
Author: jadore801120@gmail.com
File Name: transformer/Translator.py
Class Name: Translator
Method Name: __init__