## Description ##
Current implementation of Batchnorm does not support ignoring the beta 
parameter. However, it does support fixing the gamma parameter via 'fix_gamma' 
boolean parameter, default to True.

In this PR:
1. Add new option in Batchnorm 'fix_beta' and update batchnorm operator to 
support ignoring the beta in forward and backward calculation.
2. Gluon had a bug - Takes a boolean parameter 'center' and 'scale' where 
center=Beta and scale=Gamma. However, behind the scene it was ignoring 'center' 
parameter as symbolic API did not had that support. This PR fixes it to pass 
fix_beta param.

Related issue - https://github.com/apache/incubator-mxnet/issues/11774
This will also be useful in Keras-MXNet.

## Checklist ##
### Essentials ###
Please feel free to remove inapplicable items for your PR.
- [X] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the 
relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
- [ ] Changes are complete (i.e. I finished coding on this PR)
- [ ] All changes have test coverage:
- Unit tests are added for small changes to verify correctness (e.g. adding a 
new operator)
- Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
- Build tests will be added for build configuration changes (e.g. adding a new 
build option with NCCL)
- [X] Code is well-documented: 
- For user-facing API changes, API doc string has been updated. 
- For new C++ functions in header files, their functionalities and arguments 
are documented. 
- For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
- Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
- [X] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change

### Changes ###
- [X] Support fix_beta in Batchnorm
- [X] Support center=False in Gluon
- [ ] Tests

## Comments ##
Testing done:
1. Tests are passing.
2. Tested one end to end example - 
https://gluon.mxnet.io/chapter04_convolutional-neural-networks/cnn-batch-norm-gluon.html

@roywei, @eric-haibin-lin - Can you please provide your initial comments? 
While, I work on GPU tests.

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

Reply via email to