-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Closed
Labels
Description
In MVNLayer's forward, there's lots of cases where there's a gemv between a num-by-dim matrix and sum_multiplier_. When across_channels is true, dim will be channels*width*height. Unfortunately for the gemv, sum_multiplier_ is only width*height, since it's created with
sum_multiplier_.Reshape(1, 1,
bottom[0]->height(), bottom[0]->width());
Dtype* multiplier_data = sum_multiplier_.mutable_cpu_data();
caffe_set(sum_multiplier_.count(), Dtype(1), multiplier_data);
Hence, the gemv multiplies the matrix by random garbage whenever this flag is active.
The fix is just to check for across_channels during init and, if it's true, initialize sum_multiplier to be channels*width*height With this fix at least forward() seems to work properly. Since I'm guessing that the layer hasn't been extensively tested with this flag enabled, somebody may want to test backward() too...
Reactions are currently unavailable