@@ -9,8 +9,6 @@ Created by `Hang Zhang <http://hangzh.com/>`_
An optimized PyTorch package with CUDA backend.
.. note::
PyTorch compatible Synchronized Cross-GPU :class:`encoding.nn.SyncBatchNorm2d` and the `MNIST example <https://github.com/zhanghang1989/PyTorch-SyncBatchNorm>`_.
Standard BN [1]_ implementation only normalize the data within each device.
Standard BN [1]_ implementation only normalize the data within each device (GPU).
SyncBN normalizes the input within the whole mini-batch.
We follow the sync-onece implmentation described in the paper [2]_ .
Please see the design idea in the `notes <./notes/syncbn.html>`_.
.. note::
Please use ``CUDA_VISIBLE_DEVICES`` to select number of GPUs.
We adapt the awesome python API from another `PyTorch SyncBN Implementation
<https://github.com/vacancy/Synchronized-BatchNorm-PyTorch>`_ and provide
efficient CUDA backend.
.. math::
...
...
@@ -125,9 +170,9 @@ class BatchNorm2d(_SyncBatchNorm):
.. [2] Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, and Amit Agrawal. "Context Encoding for Semantic Segmentation." *CVPR 2018*
Examples:
>>> # Use exactly the same as standard BatchNrom2d