caffe2_cpp_tutorial icon indicating copy to clipboard operation
caffe2_cpp_tutorial copied to clipboard

Batch normalization

Open edubois opened this issue 6 years ago • 1 comments

I'm reading the example provided here, trying to adapt what I read to another net: https://github.com/leonardvandriel/caffe2_cpp_tutorial/blob/master/include/caffe2/zoo/resnet.h

I just wanted to know, when doing a batch normalization, I see that you are adding some inputs: predict.AddInput(p + "_s"); predict.AddInput(p + "_b"); predict.AddInput(p + "_rm"); predict.AddInput(p + "_riv");

I guess those are the scale, bias, mean and variance values of the input layer of the BN. My question is: are those holders linked/computed by caffe2 or shall I link them / compute them in some way? I'm not sure why we need to add inputs.

edubois avatar Mar 15 '18 21:03 edubois

Hi, these parameters are trained by the SpatialBN operator provided bool train is set to true, and should not require any intervention from your side.

leovandriel avatar Mar 21 '18 22:03 leovandriel