pinpom commented on a change in pull request #494: SINGA-475 add SoftPlus 
operator
URL: https://github.com/apache/incubator-singa/pull/494#discussion_r309088705
 
 

 ##########
 File path: test/python/test_operation.py
 ##########
 @@ -610,6 +610,17 @@ def test_Atanh_gpu(self):
         np.testing.assert_array_almost_equal(tensor.to_numpy(result), XT, 
decimal=5)
         self.check_shape(dx.shape(), (3, 2))
 
+    def test_SoftPlus(self):
+        X=np.array([1.0,2.0,3.0,4.0,5.0,6.0]).reshape(3,2).astype(np.float32)
+        XT=np.log(np.exp(X) + 1)
+        x=tensor.from_numpy(X)
+        x.to_device(gpu_dev)
+
+        result=autograd.softplus(x)
+        dx=result.creator.backward(x.data)
 
 Review comment:
   I added gradient test

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to