BatchNorm momentum convention PyTorch

自闭症网瘾萝莉.ら 提交于 2020-07-17 05:46:04

问题


Is the batchnorm momentum convention (default=0.1) correct as in other libraries e.g. Tensorflow it seems to usually be 0.9 or 0.99 by default? Or maybe we are just using a different convention?


回答1:


It seems that the parametrization convention is different in pytorch than in tensorflow, so that 0.1 in pytorch is equivalent to 0.9 in tensorflow.

To be more precise:

In Tensorflow:

running_mean = decay*running_mean + (1-decay)*new_value

In PyTorch:

running_mean = (1-decay)*running_mean + decay*new_value

This means that a value of decay in PyTorch is equivalent to a value of (1-decay) in Tensorflow.



来源:https://stackoverflow.com/questions/48345857/batchnorm-momentum-convention-pytorch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!