Beispiel #1
0
 def test_relu(self):
     # make sure its the same as tensorflow
     x = np.array([-1., 2., 3., 4.])
     astroNN_x = relu(x)
     with tf.device("/cpu:0"), context.eager_mode():
         tf_x = tf.nn.relu(tf.convert_to_tensor(x))
         npt.assert_array_equal(tf_x.numpy(), astroNN_x)
Beispiel #2
0
 def test_relu(self):
     # make sure its the same as tensorflow
     x = np.array([-1., 2., 3., 4.])
     tf_x = tf.nn.relu(tf.convert_to_tensor(x))
     astroNN_x = relu(x)
     npt.assert_array_equal(tf_x.eval(session=get_session()), astroNN_x)
Beispiel #3
0
 def test_relu(self):
     # make sure its the same as tensorflow
     x = np.array([-1., 2., 3., 4.])
     astroNN_x = relu(x)
     tf_x = tf.nn.relu(tf.convert_to_tensor(x))
     npt.assert_array_equal(tf_x.numpy(), astroNN_x)