如果您只想汇集前两个空间维度,则可以 "Reshape" 4D(“挤压”通道和时间维度),然后池 "Reshape" 回到5D:
"Reshape"
layer { name: "pool/reshape4D" type: "Reshape" bottom: "in" top: "pool/reshape4D" reshape_param { axis: 1 num_axes: 1 shape { dim: -1 } } } layer { name: "pool" type: "Pooling" bottom: "pool/reshape4D" top: "pool" # pooling params here... } layer { name: "pool/reshape5D" type: "Reshape" bottom: "pool" top: "pool/reshape5D" reshape_param { axis: 1 num_axes: 1 shape { dim: -1 dim: <temporal_dim> } } # replace <.> with the actual temporal dimension size. }
看到的定义 ReshapeParameter 在 caffe.proto 更多细节。
ReshapeParameter
caffe.proto