Example #1
0
 def test_tf_check_shape_deep_monitored_params(self):
     p = make_param_tf(constant=self.inp, shape=self.shape, monitor=True)
     self.sess.run(tf.global_variables_initializer())
     self.assertEqual(p.shape, self.shape)
Example #2
0
 def test_tf_check_shape_deep_params(self):
     p = make_param_tf(shape=self.shape)
     self.sess.run(tf.global_variables_initializer())
     self.assertEqual(p.shape, self.shape)
Example #3
0
 def test_tf_regul_interval_param_name(self):
     p = make_param_tf(name='param3',
                       interval=self.interval,
                       regularize=True)
     self.assertEquals(p.name, 'regularized/param3:0')
Example #4
0
 def test_tf_constant_monitored_param(self):
     p = make_param_tf(constant=self.inp, monitor=True)
     self.sess.run(tf.global_variables_initializer())
     p_res = self.sess.run(p)
     self.assertAlmostEqual(p_res, self.inp)
Example #5
0
 def test_tf_regul_normal_param_name(self):
     p = make_param_tf(name='param2', stdev=self.inp, regularize=True)
     self.assertEquals(p.name, 'regularized/param2:0')
Example #6
0
 def test_tf_regul_constant_param_name(self):
     p = make_param_tf(name='param1', constant=self.inp, regularize=True)
     self.assertEquals(p.name, 'regularized/param1:0')
Example #7
0
 def test_tf_regul_param_name(self):
     p = make_param_tf(name='param', regularize=True)
     self.assertEquals(p.name, 'regularized/param:0')
Example #8
0
 def test_tf_make_interval_param(self):
     p = make_param_tf(interval=self.interval, seed=self.seed)
     self.sess.run(tf.global_variables_initializer())
     p_res = self.sess.run(p)
     self.assertAlmostEqual(p_res, -0.5219252, delta=0.0001)
Example #9
0
 def test_tf_make_normal_param(self):
     p = make_param_tf(stdev=self.inp, seed=self.seed)
     self.sess.run(tf.global_variables_initializer())
     p_res = self.sess.run(p)
     self.assertAlmostEqual(p_res, -0.4056591, delta=0.0001)