Skip to content

Caffe:Tour:LayerCatalogue

To create a Caffe model you need to define the model architecture in a protocol buffer definition file (prototxt).

Vision Layers

  • Header: include/caffe/vision_layers.hpp

비전층은 일반적으로 획득한 이미지를 입력으로(INPUT), 출력으로(OUTPUT) 다른 이미지를 생성한다. 1

  • Convolution
  • Pooling
  • Local Response Normalization (LRN)
  • im2col

Loss Layers

Loss drives learning by comparing an output to a target and assigning cost to minimize. The loss itself is computed by the forward pass and the gradient w.r.t. to the loss is computed by the backward pass.

  • Softmax
  • Sum-of-Squares / Euclidean
  • Hinge / Margin
  • Sigmoid Cross-Entropy
  • Infogain
  • Accuracy and Top-k

Activation / Neuron Layers

In general, activation / Neuron layers are element-wise operators, taking one bottom blob and producing one top blob of the same size.

  • ReLU / Rectified-Linear and Leaky-ReLU
  • Sigmoid
  • TanH / Hyperbolic Tangent
  • Absolute Value
  • Power
  • BNLL

Data Layers

Data enters Caffe through data layers: they lie at the bottom of nets. Data can come from efficient databases (LevelDB or LMDB), directly from memory, or, when efficiency is not critical, from files on disk in HDF5 or common image formats.

  • Database
  • In-Memory
  • HDF5 Input
  • HDF5 Output
  • Images
  • Windows
  • Dummy

Common Layers

Inner Product

  • num_output: the number of filters.
    (아마도) 마지막 레이어에서 이 수치를 사용하여 라벨(Label or Filter)을 분류한다. train_val.prototxtdeploy.prototxt의 마지막 레이어에 존재하는 num_output값에 주목해야 한다. 2
layer {
  name: "fc8"
  type: "InnerProduct"
  # ...
  inner_product_param {
    num_output: 1000
    # ...
  }
  # ...
}

Splitting

Flattening

Reshape

Concatenation

Slicing

Elementwise Operations

Argmax

Softmax

Mean-Variance Normalization

See also

Favorite site

References


  1. 원문: Vision layers usually take images as input and produce other images as output. 

  2. what is batch_size mean? #585