ZhennanQin opened a new issue #12681: Batch_norm parameter names mismatch on 
gluon
URL: https://github.com/apache/incubator-mxnet/issues/12681
 
 
   In python/mxnet/gluon/nn/basic_layers.py:
   
   ```
   class BatchNorm(HybridBlock):
   ...
       moving_mean_initializer: str or `Initializer`, default 'zeros'
           Initializer for the moving mean.
       moving_variance_initializer: str or `Initializer`, default 'ones'
           Initializer for the moving variance.
   ...
       def __init__(self, axis=1, momentum=0.9, epsilon=1e-5, center=True, 
scale=True,
                    use_global_stats=False, beta_initializer='zeros', 
gamma_initializer='ones',
                    running_mean_initializer='zeros', 
running_variance_initializer='ones',
                    in_channels=0, **kwargs):
   ```
   
   Should we rename running_mean_initializer to moving_mean_initializer, and 
running_variance_initializer to moving_variance_initializer?
   
   Also, 
   
   ```
           self.running_mean = self.params.get('running_mean', grad_req='null',
                                               shape=(in_channels,),
                                               init=running_mean_initializer,
                                               allow_deferred_init=True,
                                               differentiable=False)
           self.running_var = self.params.get('running_var', grad_req='null',
                                              shape=(in_channels,),
                                              init=running_variance_initializer,
                                              allow_deferred_init=True,
                                              differentiable=False)
   ```
   
   'running_mean' and 'running_var' are mismatched with op definition:
   ```
   NNVM_REGISTER_OP(BatchNorm)
   .set_attr<nnvm::FListInputNames>("FListInputNames",
       [](const NodeAttrs& attrs) {
     return std::vector<std::string>{"data", "gamma", "beta", "moving_mean", 
"moving_var"};
   })
   ```
   This will cause trouble for parameter checking. Shall we align them?

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


With regards,
Apache Git Services

Reply via email to