Jermmy/pytorch-quantization-demo

计算移动平均值有误, BN的momentum默认值是0.1不是0.9

Closed this issue · 2 comments

https://github.com/Jermmy/pytorch-quantization-demo/blob/master/module.py#L351-L356

self.bn_module.running_mean = \
                self.bn_module.momentum * self.bn_module.running_mean + \
                (1 - self.bn_module.momentum) * mean
self.bn_module.running_var = \
                self.bn_module.momentum * self.bn_module.running_var + \
                (1 - self.bn_module.momentum) * var

@tangzhongliang 感谢指出,已更正。