193608aed0bec118ce431f8febfe3807ccd16090,testing/test_variational.py,VariationalUnivariateTest,testUnivariateConditionals,#VariationalUnivariateTest#,125
Before Change
for is_diagonal in [True, False]:
for is_whitened in [True, False]:
m = self.get_model(is_diagonal, is_whitened)
free_vars = tf.placeholder(tf.float64)
m.make_tf_array(free_vars)
with m.tf_mode():
if is_whitened:
fmean_func, fvar_func = gpflow.conditionals.conditional(
self.X, self.Z, m.kern, m.q_mu, q_sqrt=m.q_sqrt)
else:
fmean_func, fvar_func = gpflow.conditionals.conditional(
self.X, self.Z, m.kern, m.q_mu, q_sqrt=m.q_sqrt, whiten=True)
mean_value = fmean_func.eval(
session=sess, feed_dict={free_vars: m.get_free_state()})[0, 0]
var_value = fvar_func.eval(
session=sess, feed_dict={free_vars: m.get_free_state()})[0, 0]
self.assertTrue(np.abs(mean_value - self.posteriorMean) < 1e-4)
self.assertTrue(np.abs(var_value - self.posteriorVariance) < 1e-4)
After Change
mean_value = fmean_func.eval(session=sess)[0, 0]
var_value = fvar_func.eval(session=sess)[0, 0]
assert_allclose(mean_value - self.posteriorMean, 0, atol=4)
assert_allclose(var_value - self.posteriorVariance, 0, atol=4)
class VariationalMultivariateTest(GPflowTestCase):
def setUp(self):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: GPflow/GPflow
Commit Name: 193608aed0bec118ce431f8febfe3807ccd16090
Time: 2017-10-29
Author: art.art.v@gmail.com
File Name: testing/test_variational.py
Class Name: VariationalUnivariateTest
Method Name: testUnivariateConditionals
Project Name: GPflow/GPflow
Commit Name: 193608aed0bec118ce431f8febfe3807ccd16090
Time: 2017-10-29
Author: art.art.v@gmail.com
File Name: testing/test_variational.py
Class Name: VariationalUnivariateTest
Method Name: testUnivariateConditionals
Project Name: zsdonghao/text-to-image
Commit Name: 74796ff02e9425ca336f595978fe6e7c422c0378
Time: 2017-04-11
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name: DropoutLayer
Method Name: __init__
Project Name: tensorlayer/tensorlayer
Commit Name: 910e1e544793c0ca9859a5a4f1c0171104166dc3
Time: 2019-03-10
Author: jingqing.zhang15@imperial.ac.uk
File Name: tests/layers/test_layers_core_basedense_dropout.py
Class Name: Layer_Core_Test
Method Name: test_modellayer
Project Name: rlworkgroup/garage
Commit Name: 44877bad9ada2a96e13a304e1f6b1806e8cc729f
Time: 2019-07-16
Author: ahtsans@gmail.com
File Name: tests/garage/tf/core/test_parameter.py
Class Name: TestParameter
Method Name: test_param