You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/05/16 01:01:50 UTC

[GitHub] [incubator-mxnet] mseth10 commented on issue #14721: Random number generator seed setting does not always work for `mxnet.ndarray.linalg.potrf`

mseth10 commented on issue #14721: Random number generator seed setting does not always work for `mxnet.ndarray.linalg.potrf`
URL: https://github.com/apache/incubator-mxnet/issues/14721#issuecomment-492876912
 
 
   @iaroslav-ai , I tried reproducing the error, but wasn't able to. I ran the code given by you 10,000 times and it produces the same `L` every iteration. Also, I checked the code for `potrf` and found that the implementation does not involve a random generator, so having the same output is expected.
   
   I am using the same version of MXNet and ran the code on CPU. Are you using GPU?
   
   Code used (with slight modification):
   ```
   import numpy as np
   import mxnet as mx
   from mxnet import nd
   
   K = nd.load("K-1-1")[0]
   L_previous = None
   
   for i in range(10000):
       np.random.seed(0)
       mx.random.seed(0)
   
       L = nd.linalg.potrf(K)
   
       if L_previous is not None:
           # print("Result difference, should be 0:", nd.sum(nd.abs(L-L_previous)))
           is_unequal = nd.sum(1 - nd.equal(L, L_previous)) # 0 if same
           if is_unequal:
               print ('ERROR')
               break
   
       L_previous = L
   
   ```

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