Please ignore my previous comment. Thanks to Sina, for letting me know that 
seeding should happen just before the weight initialization to have 
deterministic behavior.
I verified that the initial state of all parameters across both the runs are 
same.
Sample code:

## Run 1
```
mx.random.seed(42)
w = gluon.parameter.Parameter('weight', shape = (3,3))
w.initialize(init=mx.initializer.Xavier(magnitude=2.0), ctx=mx.gpu(0))
```
```
[[ 0.53740764  0.4047128   0.09500974]
 [ 0.10734546  0.21412051  0.81077886]
 [ 0.39387202  0.0689261  -0.65652549]]
<NDArray 3x3 @cpu(0)>
```

## Run 2
```
mx.random.seed(42)
w.initialize(init=mx.initializer.Xavier(magnitude=2.0), ctx=mx.gpu(0), 
force_reinit=True)
w.data()
```

```
[[ 0.53740764  0.4047128   0.09500974]
 [ 0.10734546  0.21412051  0.81077886]
 [ 0.39387202  0.0689261  -0.65652549]]
<NDArray 3x3 @gpu(0)>
```

[ Full content available at: 
https://github.com/apache/incubator-mxnet/issues/9410 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to