Пример #1
0
 def test_log(self):
     """Test that Log can be invoked."""
     value = np.random.uniform(size=(2, 3)).astype(np.float32)
     with self.test_session() as sess:
         result = Log()(value).eval()
         assert np.array_equal(np.log(value), result)
         assert np.all(np.isclose(np.log(value), result, atol=0.001))
Пример #2
0
def test_Log_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Log(feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()