Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compatibility with recent versions of standard BatchNorm, update comm…
…ents, code clean-up Summary: This updates ABN, InPlaceABN and InPlaceABNSync to have feature parity with recent versions of Pytorch's BatchNormNd layers: * Add a `track_running_stats` parameter to enable / disable computation of running statistics independently from the layer's `training` state * Add a `num_batches_tracked` buffer, and allow passing `momentum=None` to support cumulative moving average for tracking running stats instead of exponential moving average * As a side-effect, now support loading parameters from standard BatchNorm without work-arounds. Still, if the loaded parameters contain negative `weight` elements the output will differ compared to standard BatchNorm Additional changes: * **Fix** backward pass in `eval` mode: it was not properly accounting for the activation function * Refactor library code to follow more sensible formatting standards * Add type annotations * Improve docstrings * Update installation instructions, pointing to the PyPI package Reviewed By: pkontschieder, acolovic Differential Revision: D23475677 fbshipit-source-id: 98b9d881e209b16232dd9719cf235add44aa5291
- Loading branch information