usage of concat layer

来源:互联网 发布:php 开源 api文档工具 编辑:程序博客网 时间:2024/06/07 06:00
Concatenation

LayerType: CONCAT
CPU implementation: ./src/caffe/layers/concat_layer.cpp
CUDA GPU implementation: ./src/caffe/layers/concat_layer.cu
Parameters (ConcatParameter concat_param)
Optional
concat_dim [default 1]: 0 for concatenation along num and 1 for channels.
Input
n_i * c_i * h * w for each input blob i from 1 to K.
Output

if concat_dim = 0:

(n_1 + n_2 + ... + n_K) * c_1 * h * w, and all input c_i should be the same.

for example, two images img0, img1, which both have three channels, so im0: R0, G0, B0 and  im1: R1, G1, B1, in this case,

after concatenation along image_num, the output blob is R0, G0, B0, R1, G1, B1.


if concat_dim = 1:

n_1 * (c_1 + c_2 + ... + c_K) * h * w, and all input n_i should be the same.

for example, two images img0, img1, which both have three channels, so im0: R0, G0, B0 and  im1: R1, G1, B1, in this case,

after concatenation along image_num, the output blob is R0, R1, G0, G1, B0, B1.

Sample

layers {
name: "concat"
bottom: "in1"
bottom: "in2"
top: "out"
type: CONCAT
concat_param {
concat_dim: 1
}
}

The CONCAT layer is a utility layer that concatenates its multiple input blobs to one single output blob. Currently, the layer supports concatenation along num or channels only.
0 0
原创粉丝点击