c66635795622785313cc29fb8da41731a1a809ab,allennlp/tests/nn/regularizers_test.py,TestRegularizers,test_regularizer_applicator_respects_regex_matching,#TestRegularizers#,32
Before Change
torch.nn.Linear(5, 10),
torch.nn.Linear(10, 5)
)
initializer = InitializerApplicator([(".*", lambda tensor: constant_(tensor, 1.))])
initializer(model)
value = RegularizerApplicator([("weight", L2Regularizer(0.5)),
("bias", L1Regularizer(1.0))])(model)
After Change
torch.nn.Linear(5, 10),
torch.nn.Linear(10, 5)
)
constant_init = Initializer.from_params(Params({"type": "constant", "val": 1.}))
initializer = InitializerApplicator([(".*", constant_init)])
initializer(model)
value = RegularizerApplicator([("weight", L2Regularizer(0.5)),
("bias", L1Regularizer(1.0))])(model)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: allenai/allennlp
Commit Name: c66635795622785313cc29fb8da41731a1a809ab
Time: 2018-12-17
Author: danieldeutsch@users.noreply.github.com
File Name: allennlp/tests/nn/regularizers_test.py
Class Name: TestRegularizers
Method Name: test_regularizer_applicator_respects_regex_matching
Project Name: allenai/allennlp
Commit Name: c66635795622785313cc29fb8da41731a1a809ab
Time: 2018-12-17
Author: danieldeutsch@users.noreply.github.com
File Name: allennlp/tests/modules/augmented_lstm_test.py
Class Name: TestAugmentedLSTM
Method Name: test_augmented_lstm_computes_same_function_as_pytorch_lstm
Project Name: allenai/allennlp
Commit Name: c66635795622785313cc29fb8da41731a1a809ab
Time: 2018-12-17
Author: danieldeutsch@users.noreply.github.com
File Name: allennlp/tests/nn/regularizers_test.py
Class Name: TestRegularizers
Method Name: test_l2_regularization