concat层 --caffe

caffe中concat详解:http://caffe.berkeleyvision.org/tutorial/layers/concat.html

Concat Layer

  • Layer type: Concat
  • Doxygen Documentation
  • Header: ./include/caffe/layers/concat_layer.hpp
  • CPU implementation: ./src/caffe/layers/concat_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/concat_layer.cu
  • Input
    • n_i * c_i * h * w for each input blob i from 1 to K.
  • Output
    • if axis = 0(n_1 + n_2 + ... + n_K) * c_1 * h * w, and all input c_i should be the same.
    • if axis = 1n_1 * (c_1 + c_2 + ... + c_K) * h * w, and all input n_i should be the same.
  • Sample

    layer {
      name: "concat"
      bottom: "in1"
      bottom: "in2"
      top: "out"
      type: "Concat"
      concat_param {
        axis: 1
      }
    }
    

The Concat layer is a utility layer that concatenates its multiple input blobs to one single output blob.

Parameters

  • Parameters (ConcatParameter concat_param)
    • Optional
      • axis [default 1]: 0 for concatenation along num and 1 for channels.
  • From ./src/caffe/proto/caffe.proto):
message ConcatParameter {
  // The axis along which to concatenate -- may be negative to index from the
  // end (e.g., -1 for the last axis).  Other axes must have the
  // same dimension for all the bottom blobs.
  // By default, ConcatLayer concatenates blobs along the "channels" axis (1).
  optional int32 axis = 2 [default = 1];

  // DEPRECATED: alias for "axis" -- does not support negative indexing.
  optional uint32 concat_dim = 1 [default = 1];
}

你可能感兴趣的:(concat层 --caffe)