92d566ab31e5e341d79209d96aef2c2e5d54fd0e,snli/train.py,,,#,15
Before Change
train, val, test = datasets.SNLI.splits(inputs, answers)
inputs.build_vocab(train)
answers.build_vocab(train)
train_iter, val_iter, test_iter = data.BucketIterator.splits(
(train, val, test), batch_size=args.batch_size, device=args.gpu)
After Change
train, val, test = datasets.SNLI.splits(inputs, answers)
inputs.build_vocab(train, vectors=(args.data_cache, args.word_vectors, args.d_embed))
answers.build_vocab(train)
train_iter, val_iter, test_iter = data.BucketIterator.splits(
(train, val, test), batch_size=args.batch_size, device=args.gpu)
config = args
config.n_embed = len(inputs.vocab)
config.d_out = len(answers.vocab)
config.n_cells = config.n_layers
if config.bidirectional:
config.n_cells *= 2
model = SNLIClassifier(config)
if args.wv_path:
model.embed.weight = inputs.vocab.vectors
model.cuda()
criterion = nn.CrossEntropyLoss()
opt = O.Adam(model.parameters(), lr=args.lr)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: pytorch/examples
Commit Name: 92d566ab31e5e341d79209d96aef2c2e5d54fd0e
Time: 2017-01-23
Author: bryan.mccann.is@gmail.com
File Name: snli/train.py
Class Name:
Method Name:
Project Name: pytorch/examples
Commit Name: 92d566ab31e5e341d79209d96aef2c2e5d54fd0e
Time: 2017-01-23
Author: bryan.mccann.is@gmail.com
File Name: snli/train.py
Class Name:
Method Name:
Project Name: pytorch/examples
Commit Name: 9108041562e1b7a4fb159a8c0afe0caf54fe2a6d
Time: 2017-02-06
Author: bryan.mccann.is@gmail.com
File Name: snli/train.py
Class Name:
Method Name: