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/07/23 22:49:00 UTC

[GitHub] [incubator-mxnet] econti opened a new issue #15644: BatchNorm Issue

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:
users@infra.apache.org


With regards,
Apache Git Services