c96426399886503e71a4501d308bd7f7ef2aa9e9,tests/models/decomposable_attention_test.py,TestDecomposableAttention,setUp,#TestDecomposableAttention#,17
Before Change
def setUp(self):
super(TestDecomposableAttention, self).setUp()
dataset = SnliReader().read("tests/fixtures/data/snli.jsonl")
vocab = Vocabulary.from_dataset(dataset)
self.vocab = vocab
dataset.index_instances(vocab)
self.dataset = dataset
self.token_indexers = {"tokens": SingleIdTokenIndexer()}
params = Params.from_file("tests/fixtures/decomposable_attention/experiment.json")["model"]
params.pop("type")
self.model = DecomposableAttention.from_params(self.vocab, params)
initializer = InitializerApplicator()
initializer(self.model)
def test_forward_pass_runs_correctly(self):
After Change
class TestDecomposableAttention(ModelTestCase):
def setUp(self):
super(TestDecomposableAttention, self).setUp()
self.set_up_model("tests/fixtures/decomposable_attention/experiment.json",
"tests/fixtures/data/snli.jsonl")
def test_forward_pass_runs_correctly(self):
training_arrays = arrays_to_variables(self.dataset.as_array_dict())
_ = self.model.forward(**training_arrays)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 18
Instances
Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/decomposable_attention_test.py
Class Name: TestDecomposableAttention
Method Name: setUp
Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/bidaf_test.py
Class Name: BidirectionalAttentionFlowTest
Method Name: setUp
Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/decomposable_attention_test.py
Class Name: TestDecomposableAttention
Method Name: setUp
Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/simple_tagger_test.py
Class Name: SimpleTaggerTest
Method Name: setUp
Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/semantic_role_labeler_test.py
Class Name: SemanticRoleLabelerTest
Method Name: setUp