leezu opened a new issue #7410: mxnet random seed should not be fixed by default
URL: https://github.com/apache/incubator-mxnet/issues/7410
 
 
   mxnet seems to use a fixed seed for its random number generator. This is not 
good. To make sure research results are valid, experiments need to be repeated 
with different random initializations. To the best of my knowledge it is common 
practice that the seed for the random number generator is chosen by default 
randomly at startup. At least that is the behaviour of numpy.
   
   Compare what happens when running the following two files repeatedly:
   ```
   ?  ~ cat nprandom.py 
   import numpy as np
   print(np.random.normal(size=(2,2)))
   ?  ~ cat mxrandom.py 
   import mxnet as mx
   print(mx.nd.random_normal(shape=(2,2)))
   ```
   ```
   ?  ~ python3 nprandom.py
   [[ 0.07005017 -0.10707515]
    [ 0.99219416  0.16670986]]
   ?  ~ python3 nprandom.py
   [[ 1.2185212  -1.56751472]
    [ 1.14549379 -1.90969064]]
   ```
   
   ```
   ?  ~ python3 mxrandom.py
   
   [[ 2.21220636  1.16307867]
    [ 0.7740038   0.48380461]]
   <NDArray 2x2 @cpu(0)>
   ?  ~ python3 mxrandom.py
   
   [[ 2.21220636  1.16307867]
    [ 0.7740038   0.48380461]]
   <NDArray 2x2 @cpu(0)>
   ```
   
   I.e. mxnet random number generator uses the same seed..
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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