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/06/12 19:52:39 UTC
[GitHub] [incubator-mxnet] eric-haibin-lin opened a new issue #15225:
nd.random is not really random
eric-haibin-lin opened a new issue #15225: nd.random is not really random
URL: https://github.com/apache/incubator-mxnet/issues/15225
numpy random module uses a different seed each time program starts:
```
python
>>> import numpy as np; np.random.randint(10)
4
```
```
[ec2-user@ip-172-31-10-195 bert]$ python
Python 2.7.16 (default, Mar 18 2019, 18:38:44)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
>>> import numpy as np; np.random.randint(10)
>>> 1
```
however, mxnet has a fixed random seed:
```
Type "help", "copyright", "credits" or "license" for more information.
>>> import mxnet as mx; mx.nd.random.randint(low=0, high=10)
[1]
<NDArray 1 @cpu(0)>
```
```
Type "help", "copyright", "credits" or "license" for more information.
>>> import mxnet as mx; mx.nd.random.randint(low=0, high=10)
[1]
<NDArray 1 @cpu(0)>
```
@astonzhang also find this behavior confusing for d2l readers. We should fix it for our numpy compatible feature.
@haojin2 @reminisce
----------------------------------------------------------------
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