49a385eae93032125a6718433b3ca1753aee3b1e,testing/test_method_equivalence.py,TestEquivalence,test_all,#TestEquivalence#,87
Before Change
def test_all(self):
with self.test_context():
likelihoods = np.array([
-m._objective(m.get_free_state())[0].squeeze()
for m in self.models])
self.assertTrue(np.allclose(likelihoods, likelihoods[0], 1e-6))
variances, lengthscales = [], []
for m in self.models:
if hasattr(m.kern, "rbf"):
After Change
opt = gpflow.train.ScipyOptimizer()
opt.minimize(m, maxiter=300)
neg_obj = tf.negative(m.objective)
likelihoods.append(m.session.run(neg_obj).squeeze())
assert_allclose(likelihoods, likelihoods[0], rtol=1e-6)
variances, lengthscales = [], []
for m in self.models:
if hasattr(m.kern, "rbf"):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: GPflow/GPflow
Commit Name: 49a385eae93032125a6718433b3ca1753aee3b1e
Time: 2017-11-02
Author: art.art.v@gmail.com
File Name: testing/test_method_equivalence.py
Class Name: TestEquivalence
Method Name: test_all
Project Name: OpenNMT/OpenNMT-py
Commit Name: 68fbfd1876c367323acf830736bae1af499cc0fe
Time: 2018-03-07
Author: dengyuntian@gmail.com
File Name: onmt/modules/Transformer.py
Class Name: TransformerDecoder
Method Name: forward
Project Name: geometalab/OSMDeepOD
Commit Name: 285dc85691241532cd976e04a089f409e44d7493
Time: 2016-08-12
Author: samuel.kurath@gmail.com
File Name: src/detection/tensor/detector.py
Class Name: Detector
Method Name: detect_multiple