Caffe layer 按首字母排序
Layer type: AbsVal
Doxygen Documentation
Header: ./include/caffe/layers/absval_layer.hpp
CPU implementation: ./src/caffe/layers/absval_layer.cpp
CUDA GPU implementation: ./src/caffe/layers/absval_layer.cu
Sample
layer {
name: "layer"
bottom: "in"
top: "out"
type: "AbsVal"
}
The AbsVal
layer computes the output as abs(x) for each input element x.
Accuracy
scores the output as the accuracy of output with respect to target – it is not actually a loss and has no backward step.
Accuracy
./include/caffe/layers/accuracy_layer.hpp
./src/caffe/layers/accuracy_layer.cpp
AccuracyParameter accuracy_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/AccuracyParameter.txt %}
{% endhighlight %}
ArgMax
./include/caffe/layers/argmax_layer.hpp
./src/caffe/layers/argmax_layer.cpp
ArgMaxParameter argmax_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/ArgMaxParameter.txt %}
{% endhighlight %}
BatchNorm
./include/caffe/layers/batch_norm_layer.hpp
./src/caffe/layers/batch_norm_layer.cpp
./src/caffe/layers/batch_norm_layer.cu
BatchNormParameter batch_norm_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/BatchNormParameter.txt %}
{% endhighlight %}
BatchReindex
./include/caffe/layers/batch_reindex_layer.hpp
./src/caffe/layers/batch_reindex_layer.cpp
./src/caffe/layers/batch_reindex_layer.cu
No parameters.
Bias
./include/caffe/layers/bias_layer.hpp
./src/caffe/layers/bias_layer.cpp
./src/caffe/layers/bias_layer.cu
BiasParameter bias_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/BiasParameter.txt %}
{% endhighlight %}
BNLL
./include/caffe/layers/bnll_layer.hpp
./src/caffe/layers/bnll_layer.cpp
./src/caffe/layers/bnll_layer.cu
The BNLL
(binomial normal log likelihood) layer computes the output as log(1 + exp(x)) for each input element x.
No parameters.
layer {
name: "layer"
bottom: "in"
top: "out"
type: BNLL
}
Clip
./include/caffe/layers/clip_layer.hpp
./src/caffe/layers/clip_layer.cpp
./src/caffe/layers/clip_layer.cu
ClipParameter clip_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ClipParameter.txt %}
{% endhighlight %}
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
axis = 0
: (n_1 + n_2 + ... + n_K) * c_1 * h * w
, and all input c_i
should be the same.axis = 1
: n_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.
ConcatParameter concat_param
)
axis
[default 1]: 0 for concatenation along num and 1 for channels../src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/ConcatParameter.txt %}
{% endhighlight %}
ContrastiveLoss
./include/caffe/layers/contrastive_loss_layer.hpp
./src/caffe/layers/contrastive_loss_layer.cpp
./src/caffe/layers/contrastive_loss_layer.cu
ContrastiveLossParameter contrastive_loss_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/ContrastiveLossParameter.txt %}
{% endhighlight %}
Convolution
./include/caffe/layers/conv_layer.hpp
./src/caffe/layers/conv_layer.cpp
./src/caffe/layers/conv_layer.cu
n * c_i * h_i * w_i
n * c_o * h_o * w_o
, where h_o = (h_i + 2 * pad_h - kernel_h) / stride_h + 1
and w_o
likewise.The Convolution
layer convolves the input image with a set of learnable filters, each producing one feature map in the output image.
Sample (as seen in ./models/bvlc_reference_caffenet/train_val.prototxt
):
layer {
name: "conv1"
type: "Convolution"
bottom: "data"
top: "conv1"
# learning rate and decay multipliers for the filters
param { lr_mult: 1 decay_mult: 1 }
# learning rate and decay multipliers for the biases
param { lr_mult: 2 decay_mult: 0 }
convolution_param {
num_output: 96 # learn 96 filters
kernel_size: 11 # each filter is 11x11
stride: 4 # step 4 pixels between each filter application
weight_filler {
type: "gaussian" # initialize the filters from a Gaussian
std: 0.01 # distribution with stdev 0.01 (default mean: 0)
}
bias_filler {
type: "constant" # initialize the biases to zero (0)
value: 0
}
}
}
ConvolutionParameter convolution_param
)
num_output
(c_o
): the number of filterskernel_size
(or kernel_h
and kernel_w
): specifies height and width of each filterweight_filler
[default type: 'constant' value: 0
]bias_term
[default true
]: specifies whether to learn and apply a set of additive biases to the filter outputspad
(or pad_h
and pad_w
) [default 0]: specifies the number of pixels to (implicitly) add to each side of the inputstride
(or stride_h
and stride_w
) [default 1]: specifies the intervals at which to apply the filters to the inputgroup
(g) [default 1]: If g > 1, we restrict the connectivity of each filter to a subset of the input. Specifically, the input and output channels are separated into g groups, and the i i ith output group channels will be only connected to the i i ith input group channels../src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/ConvolutionParameter.txt %}
{% endhighlight %}
Crop
./include/caffe/layers/crop_layer.hpp
./src/caffe/layers/crop_layer.cpp
./src/caffe/layers/crop_layer.cu
CropParameter crop_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/CropParameter.txt %}
{% endhighlight %}
Data
./include/caffe/layers/data_layer.hpp
./src/caffe/layers/data_layer.cpp
DataParameter data_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/DataParameter.txt %}
{% endhighlight %}
source
: the name of the directory containing the databasebatch_size
: the number of inputs to process at one timerand_skip
: skip up to this number of inputs at the beginning; useful for asynchronous sgdbackend
[default LEVELDB
]: choose whether to use a LEVELDB
or LMDB
Deconvolution
./include/caffe/layers/deconv_layer.hpp
./src/caffe/layers/deconv_layer.cpp
./src/caffe/layers/deconv_layer.cu
Uses the same parameters as the Convolution layer.
ConvolutionParameter convolution_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/ConvolutionParameter.txt %}
{% endhighlight %}
Dropout
./include/caffe/layers/dropout_layer.hpp
./src/caffe/layers/dropout_layer.cpp
./src/caffe/layers/dropout_layer.cu
DropoutParameter dropout_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/DropoutParameter.txt %}
{% endhighlight %}
DummyData
./include/caffe/layers/dummy_data_layer.hpp
./src/caffe/layers/dummy_data_layer.cpp
DummyDataParameter dummy_data_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/DummyDataParameter.txt %}
{% endhighlight %}
Eltwise
./include/caffe/layers/eltwise_layer.hpp
./src/caffe/layers/eltwise_layer.cpp
./src/caffe/layers/eltwise_layer.cu
EltwiseParameter eltwise_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/EltwiseParameter.txt %}
{% endhighlight %}
ELU
./include/caffe/layers/elu_layer.hpp
./src/caffe/layers/elu_layer.cpp
./src/caffe/layers/elu_layer.cu
ELUParameter elu_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ELUParameter.txt %}
{% endhighlight %}
Embed
./include/caffe/layers/embed_layer.hpp
./src/caffe/layers/embed_layer.cpp
./src/caffe/layers/embed_layer.cu
EmbedParameter embed_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/EmbedParameter.txt %}
{% endhighlight %}
EuclideanLoss
./include/caffe/layers/euclidean_loss_layer.hpp
./src/caffe/layers/euclidean_loss_layer.cpp
./src/caffe/layers/euclidean_loss_layer.cu
The Euclidean loss layer computes the sum of squares of differences of its two inputs, 1 2 N ∑ i = 1 N ∥ x i 1 − x i 2 ∥ 2 2 \frac 1 {2N} \sum_{i=1}^N \| x^1_i - x^2_i \|_2^2 2N1i=1∑N∥xi1−xi2∥22.
Does not take any parameters.
Exp
./include/caffe/layers/exp_layer.hpp
./src/caffe/layers/exp_layer.cpp
./src/caffe/layers/exp_layer.cu
Parameter exp_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ExpParameter.txt %}
{% endhighlight %}
Filter
./include/caffe/layers/filter_layer.hpp
./src/caffe/layers/filter_layer.cpp
./src/caffe/layers/filter_layer.cu
Does not take any parameters.
Flatten
./include/caffe/layers/flatten_layer.hpp
./src/caffe/layers/flatten_layer.cpp
The Flatten
layer is a utility layer that flattens an input of shape n * c * h * w
to a simple vector output of shape n * (c*h*w)
.
FlattenParameter flatten_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/FlattenParameter.txt %}
{% endhighlight %}
HDF5Data
./include/caffe/layers/hdf5_data_layer.hpp
./src/caffe/layers/hdf5_data_layer.cpp
./src/caffe/layers/hdf5_data_layer.cu
HDF5DataParameter hdf5_data_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/HDF5DataParameter.txt %}
{% endhighlight %}
HDF5Output
./include/caffe/layers/hdf5_output_layer.hpp
./src/caffe/layers/hdf5_output_layer.cpp
./src/caffe/layers/hdf5_output_layer.cu
The HDF5 output layer performs the opposite function of the other layers in this section: it writes its input blobs to disk.
Parameters (HDF5OutputParameter hdf5_output_param
)
file_name
: name of file to write toFrom ./src/caffe/proto/caffe.proto
:
{% highlight Protobuf %}
{% include proto/HDF5OutputParameter.txt %}
{% endhighlight %}
HingeLoss
./include/caffe/layers/hinge_loss_layer.hpp
./src/caffe/layers/hinge_loss_layer.cpp
HingeLossParameter hinge_loss_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/HingeLossParameter.txt %}
{% endhighlight %}
Im2col
./include/caffe/layers/im2col_layer.hpp
./src/caffe/layers/im2col_layer.cpp
./src/caffe/layers/im2col_layer.cu
Im2col
is a helper for doing the image-to-column transformation that you most
likely do not need to know about. This is used in Caffe’s original convolution
to do matrix multiplication by laying out all patches into a matrix.
ImageData
./include/caffe/layers/image_data_layer.hpp
./src/caffe/layers/image_data_layer.cpp
Parameters (ImageDataParameter image_data_parameter
)
source
: name of a text file, with each line giving an image filename and labelbatch_size
: number of images to batch togetherrand_skip
shuffle
[default false]new_height
, new_width
: if provided, resize all images to this sizeFrom ./src/caffe/proto/caffe.proto
:
{% highlight Protobuf %}
{% include proto/ImageDataParameter.txt %}
{% endhighlight %}
InfogainLoss
./include/caffe/layers/infogain_loss_layer.hpp
./src/caffe/layers/infogain_loss_layer.cpp
A generalization of MultinomialLogisticLossLayer that takes an “information gain” (infogain) matrix specifying the “value” of all label pairs.
Equivalent to the MultinomialLogisticLossLayer if the infogain matrix is the identity.
Parameter infogain_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/InfogainLossParameter.txt %}
{% endhighlight %}
Layer type: InnerProduct
Doxygen Documentation
Header: ./include/caffe/layers/inner_product_layer.hpp
CPU implementation: ./src/caffe/layers/inner_product_layer.cpp
CUDA GPU implementation: ./src/caffe/layers/inner_product_layer.cu
Input
n * c_i * h_i * w_i
Output
n * c_o * 1 * 1
Sample
layer {
name: "fc8"
type: "InnerProduct"
# learning rate and decay multipliers for the weights
param { lr_mult: 1 decay_mult: 1 }
# learning rate and decay multipliers for the biases
param { lr_mult: 2 decay_mult: 0 }
inner_product_param {
num_output: 1000
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
bottom: "fc7"
top: "fc8"
}
The InnerProduct
layer (also usually referred to as the fully connected layer) treats the input as a simple vector and produces an output in the form of a single vector (with the blob’s height and width set to 1).
InnerProductParameter inner_product_param
)
num_output
(c_o
): the number of filtersweight_filler
[default type: 'constant' value: 0
]bias_filler
[default type: 'constant' value: 0
]bias_term
[default true
]: specifies whether to learn and apply a set of additive biases to the filter outputs./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/InnerProductParameter.txt %}
{% endhighlight %}
Input
./include/caffe/layers/input_layer.hpp
./src/caffe/layers/input_layer.cpp
InputParameter input_param
)./src/caffe/proto/caffe.proto
):{% highlight Protobuf %}
{% include proto/InputParameter.txt %}
{% endhighlight %}
Log
./include/caffe/layers/log_layer.hpp
./src/caffe/layers/log_layer.cpp
./src/caffe/layers/log_layer.cu
Parameter log_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/LogParameter.txt %}
{% endhighlight %}
LRN
./include/caffe/layers/lrn_layer.hpp
./src/caffe/layers/lrn_layer.cpp
./src/caffe/layers/lrn_layer.cu
LRNParameter lrn_param
)
local_size
[default 5]: the number of channels to sum over (for cross channel LRN) or the side length of the square region to sum over (for within channel LRN)alpha
[default 1]: the scaling parameter (see below)beta
[default 5]: the exponent (see below)norm_region
[default ACROSS_CHANNELS
]: whether to sum over adjacent channels (ACROSS_CHANNELS
) or nearby spatial locations (WITHIN_CHANNEL
)The local response normalization layer performs a kind of “lateral inhibition” by normalizing over local input regions. In ACROSS_CHANNELS
mode, the local regions extend across nearby channels, but have no spatial extent (i.e., they have shape local_size x 1 x 1
). In WITHIN_CHANNEL
mode, the local regions extend spatially, but are in separate channels (i.e., they have shape 1 x local_size x local_size
). Each input value is divided by ( 1 + ( α / n ) ∑ i x i 2 ) β (1 + (\alpha/n) \sum_i x_i^2)^\beta (1+(α/n)i∑xi2)β, where n n n is the size of each local region, and the sum is taken over the region centered at that value (zero padding is added where necessary).
LRNParameter lrn_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/LRNParameter.txt %}
{% endhighlight %}
LSTM
./include/caffe/layers/lstm_layer.hpp
./src/caffe/layers/lstm_layer.cpp
./src/caffe/layers/lstm_unit_layer.cpp
./src/caffe/layers/lstm_unit_layer.cu
Parameter recurrent_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/RecurrentParameter.txt %}
{% endhighlight %}
MemoryData
./include/caffe/layers/memory_data_layer.hpp
./src/caffe/layers/memory_data_layer.cpp
The memory data layer reads data directly from memory, without copying it. In order to use it, one must call MemoryDataLayer::Reset
(from C++) or Net.set_input_arrays
(from Python) in order to specify a source of contiguous data (as 4D row major array), which is read one batch-sized chunk at a time.
MemoryDataParameter memory_data_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/MemoryDataParameter.txt %}
{% endhighlight %}
batch_size
, channels
, height
, width
: specify the size of input chunks to read from memoryMultinomialLogisticLoss
./include/caffe/layers/multinomial_logistic_loss_layer.hpp
./src/caffe/layers/multinomial_logistic_loss_layer.cpp
LossParameter loss_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/LossParameter.txt %}
{% endhighlight %}
MVN
./include/caffe/layers/mvn_layer.hpp
./src/caffe/layers/mvn_layer.cpp
./src/caffe/layers/mvn_layer.cu
MVNParameter mvn_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/MVNParameter.txt %}
{% endhighlight %}
Parameter
./include/caffe/layers/parameter_layer.hpp
./src/caffe/layers/parameter_layer.cpp
See https://github.com/BVLC/caffe/pull/2079.
ParameterParameter parameter_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ParameterParameter.txt %}
{% endhighlight %}
Layer type: Pooling
Doxygen Documentation
Header: ./include/caffe/layers/pooling_layer.hpp
CPU implementation: ./src/caffe/layers/pooling_layer.cpp
CUDA GPU implementation: ./src/caffe/layers/pooling_layer.cu
Input
n * c * h_i * w_i
Output
n * c * h_o * w_o
, where h_o and w_o are computed in the same way as convolution.Parameters (PoolingParameter pooling_param
)
kernel_size
(or kernel_h
and kernel_w
): specifies height and width of each filterpool
[default MAX]: the pooling method. Currently MAX, AVE, or STOCHASTICpad
(or pad_h
and pad_w
) [default 0]: specifies the number of pixels to (implicitly) add to each side of the inputstride
(or stride_h
and stride_w
) [default 1]: specifies the intervals at which to apply the filters to the inputFrom ./src/caffe/proto/caffe.proto
:
{% highlight Protobuf %}
{% include proto/PoolingParameter.txt %}
{% endhighlight %}
Sample (as seen in ./models/bvlc_reference_caffenet/train_val.prototxt
)
layer {
name: "pool1"
type: "Pooling"
bottom: "conv1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 3 # pool over a 3x3 region
stride: 2 # step two pixels (in the bottom blob) between pooling regions
}
}
Power
./include/caffe/layers/power_layer.hpp
./src/caffe/layers/power_layer.cpp
./src/caffe/layers/power_layer.cu
The Power
layer computes the output as (shift + scale * x) ^ power for each input element x.
Parameters (PowerParameter power_param
)
power
[default 1]scale
[default 1]shift
[default 0]From ./src/caffe/proto/caffe.proto
:
{% highlight Protobuf %}
{% include proto/PowerParameter.txt %}
{% endhighlight %}
layer {
name: "layer"
bottom: "in"
top: "out"
type: "Power"
power_param {
power: 1
scale: 1
shift: 0
}
}
PReLU
./include/caffe/layers/prelu_layer.hpp
./src/caffe/layers/prelu_layer.cpp
./src/caffe/layers/prelu_layer.cu
PReLUParameter prelu_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/PReLUParameter.txt %}
{% endhighlight %}
Python
./include/caffe/layers/python_layer.hpp
The Python layer allows users to add customized layers without modifying the Caffe core code.
PythonParameter python_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/PythonParameter.txt %}
{% endhighlight %}
Recurrent
./include/caffe/layers/recurrent_layer.hpp
./src/caffe/layers/recurrent_layer.cpp
./src/caffe/layers/recurrent_layer.cu
RecurrentParameter recurrent_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/RecurrentParameter.txt %}
{% endhighlight %}
Reduction
./include/caffe/layers/reduction_layer.hpp
./src/caffe/layers/reduction_layer.cpp
./src/caffe/layers/reduction_layer.cu
ReductionParameter reduction_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ReductionParameter.txt %}
{% endhighlight %}
Layer type: ReLU
Doxygen Documentation
Header: ./include/caffe/layers/relu_layer.hpp
CPU implementation: ./src/caffe/layers/relu_layer.cpp
CUDA GPU implementation: ./src/caffe/layers/relu_layer.cu
Sample (as seen in ./models/bvlc_reference_caffenet/train_val.prototxt
)
layer {
name: "relu1"
type: "ReLU"
bottom: "conv1"
top: "conv1"
}
Given an input value x, The ReLU
layer computes the output as x if x > 0 and negative_slope * x if x <= 0. When the negative slope parameter is not set, it is equivalent to the standard ReLU function of taking max(x, 0). It also supports in-place computation, meaning that the bottom and the top blob could be the same to preserve memory consumption.
ReLUParameter relu_param
)
negative_slope
[default 0]: specifies whether to leak the negative part by multiplying it with the slope value rather than setting it to 0../src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ReLUParameter.txt %}
{% endhighlight %}
Layer type: Reshape
Doxygen Documentation
Header: ./include/caffe/layers/reshape_layer.hpp
Implementation: ./src/caffe/layers/reshape_layer.cpp
Input
Output
reshape_param
Sample
layer {
name: "reshape"
type: "Reshape"
bottom: "input"
top: "output"
reshape_param {
shape {
dim: 0 # copy the dimension from below
dim: 2
dim: 3
dim: -1 # infer it from the other dimensions
}
}
}
The Reshape
layer can be used to change the dimensions of its input, without changing its data. Just like the Flatten
layer, only the dimensions are changed; no data is copied in the process.
Output dimensions are specified by the ReshapeParam
proto. Positive numbers are used directly, setting the corresponding dimension of the output blob. In addition, two special values are accepted for any of the target dimension values:
dim: 0
as the 1st target dimension.[]
for MATLAB’s reshape: this dimension is calculated to keep the overall element count the same as in the bottom layer. At most one -1 can be used in a reshape operation.As another example, specifying reshape_param { shape { dim: 0 dim: -1 } }
makes the layer behave in exactly the same way as the Flatten
layer.
ReshapeParameter reshape_param
)
shape
./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ReshapeParameter.txt %}
{% endhighlight %}
RNN
./include/caffe/layers/rnn_layer.hpp
./src/caffe/layers/rnn_layer.cpp
RecurrentParameter recurrent_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/RecurrentParameter.txt %}
{% endhighlight %}
Scale
./include/caffe/layers/scale_layer.hpp
./src/caffe/layers/scale_layer.cpp
./src/caffe/layers/scale_layer.cu
ScaleParameter scale_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ScaleParameter.txt %}
{% endhighlight %}
Layer type: Sigmoid
Doxygen Documentation
Header: ./include/caffe/layers/sigmoid_layer.hpp
CPU implementation: ./src/caffe/layers/sigmoid_layer.cpp
CUDA GPU implementation: ./src/caffe/layers/sigmoid_layer.cu
Example (from ./examples/mnist/mnist_autoencoder.prototxt
):
layer {
name: "encode1neuron"
bottom: "encode1"
top: "encode1neuron"
type: "Sigmoid"
}
The Sigmoid
layer computes sigmoid(x)
for each element x
in the bottom blob.
SigmoidParameter sigmoid_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/SigmoidParameter.txt %}
{% endhighlight %}
SigmoidCrossEntropyLoss
./include/caffe/layers/sigmoid_cross_entropy_loss_layer.hpp
./src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
./src/caffe/layers/sigmoid_cross_entropy_loss_layer.cu
To-do.
Silence
./include/caffe/layers/silence_layer.hpp
./src/caffe/layers/silence_layer.cpp
./src/caffe/layers/silence_layer.cu
Silences a blob, so that it is not printed.
No parameters.
Slice
./include/caffe/layers/slice_layer.hpp
./src/caffe/layers/slice_layer.cpp
./src/caffe/layers/slice_layer.cu
The Slice
layer is a utility layer that slices an input layer to multiple output layers along a given dimension (currently num or channel only) with given slice indices.
Sample
layer {
name: "slicer_label"
type: "Slice"
bottom: "label"
## Example of label with a shape N x 3 x 1 x 1
top: "label1"
top: "label2"
top: "label3"
slice_param {
axis: 1
slice_point: 1
slice_point: 2
}
}
axis
indicates the target axis; slice_point
indicates indexes in the selected dimension (the number of indices must be equal to the number of top blobs minus one).
SliceParameter slice_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/SliceParameter.txt %}
{% endhighlight %}
Softmax
./include/caffe/layers/softmax_layer.hpp
./src/caffe/layers/softmax_layer.cpp
./src/caffe/layers/softmax_layer.cu
SoftmaxParameter softmax_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/SoftmaxParameter.txt %}
{% endhighlight %}
SoftmaxWithLoss
./include/caffe/layers/softmax_loss_layer.hpp
./src/caffe/layers/softmax_loss_layer.cpp
./src/caffe/layers/softmax_loss_layer.cu
The softmax loss layer computes the multinomial logistic loss of the softmax of its inputs. It’s conceptually identical to a softmax layer followed by a multinomial logistic loss layer, but provides a more numerically stable gradient.
SoftmaxParameter softmax_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/SoftmaxParameter.txt %}
{% endhighlight %}
LossParameter loss_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/LossParameter.txt %}
{% endhighlight %}
Split
./include/caffe/layers/split_layer.hpp
./src/caffe/layers/split_layer.cpp
./src/caffe/layers/split_layer.cu
The Split
layer is a utility layer that splits an input blob to multiple output blobs. This is used when a blob is fed into multiple output layers.
Does not take any parameters.
SPP
./include/caffe/layers/spp_layer.hpp
./src/caffe/layers/spp_layer.cpp
SPPParameter spp_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/SPPParameter.txt %}
{% endhighlight %}
./include/caffe/layers/tanh_layer.hpp
./src/caffe/layers/tanh_layer.cpp
./src/caffe/layers/tanh_layer.cu
TanHParameter tanh_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/TanHParameter.txt %}
{% endhighlight %}
./include/caffe/layers/threshold_layer.hpp
./src/caffe/layers/threshold_layer.cpp
./src/caffe/layers/threshold_layer.cu
ThresholdParameter threshold_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/ThresholdParameter.txt %}
{% endhighlight %}
Tile
./include/caffe/layers/tile_layer.hpp
./src/caffe/layers/tile_layer.cpp
./src/caffe/layers/tile_layer.cu
TileParameter tile_param
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/TileParameter.txt %}
{% endhighlight %}
WindowData
./include/caffe/layers/window_data_layer.hpp
./src/caffe/layers/window_data_layer.cpp
WindowDataParameter
)./src/caffe/proto/caffe.proto
:{% highlight Protobuf %}
{% include proto/WindowDataParameter.txt %}
{% endhighlight %}