You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@singa.apache.org by GitBox <gi...@apache.org> on 2019/07/31 08:09:05 UTC

[GitHub] [incubator-singa] pinpom commented on a change in pull request #494: SINGA-475 add SoftPlus operator

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:
users@infra.apache.org


With regards,
Apache Git Services