asitstands commented on issue #9978: Error with random generator
URL: 
https://github.com/apache/incubator-mxnet/issues/9978#issuecomment-370140101
 
 
   @CoinCheung That is the usual way that pseudo random number generators work. 
They generate a sequence of pseudo random numbers. So each call of `normal` in 
a run of a script or a REPL session generates different numbers. A seeding sets 
the internal state of the generator. Thus, if you seed with the same number, 
you get the same sequence of numbers. 
   
   Mxnet seeds its generators in `mx.nd.random` with a fixed number every time 
it is initialized, and so `normal` generates the same sequence at every run of 
your script. However, the `DataLoader` uses a generator different from the 
generator of `mx.nd.random`. It uses the global generator of python which is 
seeded with different numbers at each initialization. Thus the two show 
different behaviors. One generates the same sequence at each run of the script 
while the other generates a different sequence. I think that this is confusing 
for newcomers, but anyway it is the way mxnet works.
   
   

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