转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6015990.html BatchNorm具体网上搜索. caffe中batchNorm层是通过BatchNorm+Scale实现的,但是默认没有bias.torch中的BatchNorm层使用函数SpatialBatchNormalization实现,该函数中有weight和bias. 如下代码: local net = nn.Sequential() net:add(nn.SpatialBatch…
下载caffe-local,解压缩; 修改makefile.config:我是将cuudn注释掉,去掉cpu_only的注释; make all make test(其中local_test出错,将文件中gpu部分注释掉即可) make runtest 将python路径在.bashrc中更改: export PYTHONPATH=/home/crw/caffe-local/python:$PYTHONPATH source .bashrc 或者直接vi .bashrc,在文件中更改; make…
一.前向传播 在caffe中,卷积层做卷积的过程被转化成了由卷积核的参数组成的权重矩阵weights(简记为W)和feature map中的元素组成的输入矩阵(简记为Cin)的矩阵乘积W * Cin.在进行乘积之前,需要对卷积核的参数和feature map作处理,以得到W和Cin. 下面用一个例子来说名上述两个过程.假设某一卷积层输入为c X h X w = 3 X 8 X 8的feature map,卷积核大小h1 X w1 = 2 X 2,个数c1 = 4,stride = 1,pad_h…