How should “BatchNorm” layer be used in caffe?

后端 未结 2 1974
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 16:37

I am a little confused about how should I use/insert \"BatchNorm\" layer in my models.
I see several different approaches, for instance:

ResNets: \"BatchN

2条回答
  •  佛祖请我去吃肉
    2020-12-17 17:37

    After each BatchNorm, we have to add a Scale layer in Caffe. The reason is that the Caffe BatchNorm layer only subtracts the mean from the input data and divides by their variance, while does not include the γ and β parameters that respectively scale and shift the normalized distribution 1. Conversely, the Keras BatchNormalization layer includes and applies all of the parameters mentioned above. Using a Scale layer with the parameter “bias_term” set to True in Caffe, provides a safe trick to reproduce the exact behavior of the Keras version. https://www.deepvisionconsulting.com/from-keras-to-caffe/

提交回复
热议问题