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 2018/06/14 15:21:44 UTC

[GitHub] smorrel1 opened a new issue #11283: Group Norm

smorrel1 opened a new issue #11283: Group Norm
URL: https://github.com/apache/incubator-mxnet/issues/11283
 
 
   Group norm is more accurate than Batch norm for small batches, useful for many vision tasks. See [Group Normalization](https://arxiv.org/abs/1803.08494) 
   [Pytorch](https://github.com/facebookresearch/Detectron/tree/master/projects/GN) and [Tensorflow](https://github.com/shaohua0116/Group-Normalization-Tensorflow) (code below) have implementations. Could anyone port this please? It would be really helpful for many of us but I'm not sure how to implement. Thanks!
   
   def GroupNorm(x, gamma, beta, G, eps=1eāˆ’5):
     \# x: input features with shape [N,C,H,W]
     \# gamma, beta: scale and offset, with shape [1,C,1,1] # G: number of groups for GN
     N, C, H, W = x.shape
     x = tf.reshape(x, [N, G, C // G, H, W])
     mean, var = tf.nn.moments(x, [2, 3, 4], keep dims=True) x = (x āˆ’ mean) / tf.sqrt(var + eps)
     x = tf.reshape(x, [N, C, H, W]) return x āˆ— gamma + beta
   Figure 3. Python code of Group Norm based on TensorFlow.

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


With regards,
Apache Git Services