machine-learning - caffe:5D blob 池化?

标签 machine-learning neural-network deep-learning caffe conv-neural-network

我有一个像 1x8x128x128 这样的 5D blob,并且我有一个能够处理我的 5D blob 的卷积层。当我想使用池层时,尽管它不起作用。如何将池层与 5D blob 一起使用?

Check failed: 4 == bottom[0]->num_axes() (4 vs. 5) Input must have 4 axes, corresponding to (num, channels, height, width)

我认为caffe还不支持它。我可以只使用卷积层并进行池化吗?

最佳答案

如果您只想池化前两个空间维度,您可以“ reshape ” 为 4D(“挤压” channel 和时间维度),池化,然后“ reshape ” 返回 5D:

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.
}

参见caffe.protoReshapeParameter的定义了解更多详情。

关于machine-learning - caffe:5D blob 池化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40888514/

相关文章:

machine-learning - KNN 中 k 的值

lua - 在Torch/Lua中,加载保存的模型和使用Xavier权重初始化方法有什么区别?

python - 如何在神经网络中使用 Softmax 激活函数

python - ValueError : Input 0 of layer conv2d is incompatible with the layer: : expected min_ndim=4, 发现 ndim=3。收到完整形状 : (2240, 70, 3)

python - CatBoost出现过拟合后,有办法保存训练好的模型吗?

machine-learning - 一对多 SVM 引入了类别不平衡

neural-network - 无需微积分的神经网络

python - 如何将向量中的数值和分类值组合为 LSTM 的输入?

machine-learning - 神经网络中的激活函数

machine-learning - SVM文档分类中如何计算测试文档的tf-df?