chrishkchris commented on issue #572: hotfix: cpp softmax not impl
URL: https://github.com/apache/singa/pull/572#issuecomment-574022539
 
 
   @dcslin 
   I used a simple test code to compare with pytorch when the input vector is 
of the size [1, 5]. 
   The output is the same as pytorch. I suppose the difference maybe from 
cross_entropy.
   
   1. singa
   ubuntu@ip-172-31-26-47:~$ python3 softmaxtest.py
   x = [1. 3. 5. 7. 9.]
   dy = [1. 3. 5. 7. 9.]
   y = [[2.9007587e-04 2.1433870e-03 1.5837606e-02 1.1702495e-01 8.6470395e-01]]
   dx = [[-0.00222993 -0.01219034 -0.05839987 -0.19747007  0.27029037]]
   
   2. pytorch
   (pytorch_p36) ubuntu@ip-172-31-16-63:~/pytorch_ops_test$ python 
softmaxtest.py
   x = [[1. 3. 5. 7. 9.]]
   dy = [[1. 3. 5. 7. 9.]]
   y = [2.9007587e-04 2.1433870e-03 1.5837606e-02 1.1702495e-01 8.6470395e-01]
   dx = [-0.00222993 -0.01219034 -0.05839989 -0.19747011  0.27029008]
   

----------------------------------------------------------------
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