How to Break Blob into Channels in Caffe

I would like to split Blob channels in Caffe so that I can split one Blob (N, c, w, h)into two output Blobs of size (N, c/2, w, h).

What I described above is very general, what I want to do is to separate the two-channel input image into two different images. One goes to the convolutional layer, and the other to the unification layer. Finally, I combine the outputs.

So I'm wondering if there is a Caffe layer that allows the user to do such a thing, and how to define it in the prototype file.

+4
source share
1 answer

Yes, a layer is used for this purpose Slice. From the Layer Catalog :

Slice - , ( num channel) .

Blob N x 2 x H x W Blob N x 1 x H x W, axis: 1 ( ) slice_point: 1 ( ):

layer {
  name: "slice-conv-pool"
  type: "Slice"
  bottom: "data"
  top: "conv1"
  top: "pool1"
  slice_param {
    axis: 1
    slice_point: 1
  }
}
+3

Source: https://habr.com/ru/post/1664199/


All Articles