econti opened a new issue #15644: BatchNorm Issue
URL: https://github.com/apache/incubator-mxnet/issues/15644
 
 
   mxnet's `BatchNorm` doesn't seem to modify my input when used which is 
incorrect. Could someone take a look at my code below?
   
   ```
   >>> from mxnet import gluon, nd
   >>> import mxnet as mx
   >>> import numpy as np
   >>> def mx_DNN():
   ...     mx_DNN = gluon.nn.Sequential()
   ...     with mx_DNN.name_scope():
   ...         mx_DNN.add(
   ...             gluon.nn.BatchNorm(momentum=0.1, epsilon=1e-5, center=True, 
scale=True)
   ...         )
   ...     mx_DNN.collect_params().initialize(mx.init.Normal(0.02))
   ...     return mx_DNN
   ...
   >>> mxnet_DNN = mx_DNN()
   >>> data = nd.array([[1.5, 3.0], [-2.1, 2.1]])
   >>> mxnet_DNN(data)
   
   [[ 1.4999925  2.999985 ]
    [-2.0999894  2.0999894]]
   <NDArray 2x2 @cpu(0)>
   ```
   
   Environment:
   ```
   Python 3.7.3
   [GCC 7.3.0] :: Anaconda, Inc. on linux
   mxnet-cu92==1.4.1
   ```
   
   Thanks!

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to