mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

NDArrayIter Shuffle Reproducibility

Open jimxinbo opened this issue 11 years ago • 2 comments

I cannot repeat the results every time I ran the same script.

If I fix some seeds on the initialization of the weights and set shuffle==False in mx.io.NDArrayIter. I can repeat the same results. But if I set shuffle==True in mx.io.NDArrayIter. Even by adding a mx.random.seed() before calling mx.io.NDArrayIter, I cannot get consistent results every time.

Is this because I cannot seed the shuffle of ArrayIter by now? Any way around so that I can control the shuffling for repeating results?

Thank you.

jimxinbo avatar Nov 27 '15 09:11 jimxinbo

You need to also seed numpy and random to guarantee reproducibility. @tqchen should we also seed those in mx.random.seed by default?

piiswrong avatar Nov 28 '15 02:11 piiswrong

Thx piiswrong, to also seed numpy solved it.

jimxinbo avatar Nov 29 '15 11:11 jimxinbo