caffe卷积层参数 Posted on 2017-07-07 | In 代码平台 > caffe | Visitors axis12345678910// The axis to interpret as "channels" when performing convolution.// Preceding dimensions are treated as independent inputs;// succeeding dimensions are treated as "spatial".// With (N, C, H, W) inputs, and axis == 1 (the default), we perform// N independent 2D convolutions, sliding C-channel (or (C/g)-channels, for// groups g>1) filters across the spatial axes (H, W) of the input.// With (N, C, D, H, W) inputs, and axis == 1, we perform// N independent 3D convolutions, sliding (C/g)-channels// filters across the spatial axes (D, H, W) of the input.optional int32 axis = 16 [default = 1]; 说白了,就是将哪个轴作为通道,默认为1,默认为1的话就是第二个轴为通道[0,1,2,3]。 12// Preceding dimensions are treated as independent inputs;`// succeeding dimensions are treated as "spatial". 前边的轴作为独立输入,后边的轴作为空间坐标轴。 另外一个函数: 123456789101112inline int CanonicalAxisIndex(int axis_index) const { CHECK_GE(axis_index, -num_axes()) << "axis " << axis_index << " out of range for " << num_axes() << "-D Blob with shape " << shape_string(); CHECK_LT(axis_index, num_axes()) << "axis " << axis_index << " out of range for " << num_axes() << "-D Blob with shape " << shape_string(); if (axis_index < 0) { return axis_index + num_axes(); } return axis_index; } 返回Canonical的index,字面意思是权威。实际如下: 123input: 0,1,2,3 -4,-3,-2,-1output: 0,1,2,3