Пример #1
0
 def testCompatibilityCheck(self):
     pcont_t = tf.placeholder(tf.float32, [8])
     with self.assertRaisesRegexp(
             ValueError,
             'TDLearning: Error in rank and/or compatibility check'):
         self.value_learning = value_ops.td_learning(
             self.v_tm1, self.r_t, pcont_t, self.v_t)
Пример #2
0
 def setUp(self):
     super(TDLearningTest, self).setUp()
     self.v_tm1 = tf.constant([1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=tf.float32)
     self.v_t = tf.constant([0, 0, 0, 1, 1, 1, 2, 2, 2], dtype=tf.float32)
     self.pcont_t = tf.constant([0, 0.5, 1, 0, 0.5, 1, 0, 0.5, 1],
                                dtype=tf.float32)
     self.r_t = tf.constant([-1, -1, -1, -1, -1, -1, -1, -1, -1],
                            dtype=tf.float32)
     self.value_learning = value_ops.td_learning(self.v_tm1, self.r_t,
                                                 self.pcont_t, self.v_t)