Skip to content

Commit

Permalink
Merge pull request BVLC#5148 from caffe-help/caffe-docs-PR1
Browse files Browse the repository at this point in the history
Overhaul layer catalogue documentation
  • Loading branch information
shelhamer authored Jan 18, 2017
2 parents 8065c18 + bae0607 commit 6cbc72a
Show file tree
Hide file tree
Showing 62 changed files with 1,573 additions and 476 deletions.
562 changes: 86 additions & 476 deletions docs/tutorial/layers.md

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions docs/tutorial/layers/absval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Absolute Value Layer
---

# Absolute Value Layer

* Layer type: `AbsVal`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1AbsValLayer.html)
* Header: [`./include/caffe/layers/absval_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/absval_layer.hpp)
* CPU implementation: [`./src/caffe/layers/absval_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/absval_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/absval_layer.cu`](https://github.com/BVLC/caffe/blob/master/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.
21 changes: 21 additions & 0 deletions docs/tutorial/layers/accuracy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Accuracy and Top-k
---

# Accuracy and Top-k

`Accuracy` scores the output as the accuracy of output with respect to target -- it is not actually a loss and has no backward step.

* Layer type: `Accuracy`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1AccuracyLayer.html)
* Header: [`./include/caffe/layers/accuracy_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/accuracy_layer.hpp)
* CPU implementation: [`./src/caffe/layers/accuracy_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/accuracy_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/accuracy_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/accuracy_layer.cu)

## Parameters
* Parameters (`AccuracyParameter accuracy_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/AccuracyParameter.txt %}
{% endhighlight %}
19 changes: 19 additions & 0 deletions docs/tutorial/layers/argmax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: ArgMax Layer
---

# ArgMax Layer

* Layer type: `ArgMax`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ArgMaxLayer.html)
* Header: [`./include/caffe/layers/argmax_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/argmax_layer.hpp)
* CPU implementation: [`./src/caffe/layers/argmax_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/argmax_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/argmax_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/argmax_layer.cu)

## Parameters
* Parameters (`ArgMaxParameter argmax_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/ArgMaxParameter.txt %}
{% endhighlight %}
20 changes: 20 additions & 0 deletions docs/tutorial/layers/batchnorm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Batch Norm Layer
---

# Batch Norm Layer

* Layer type: `BatchNorm`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BatchNormLayer.html)
* Header: [`./include/caffe/layers/batch_norm_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/batch_norm_layer.hpp)
* CPU implementation: [`./src/caffe/layers/batch_norm_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_norm_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/batch_norm_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_norm_layer.cu)

## Parameters

* Parameters (`BatchNormParameter batch_norm_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto):

{% highlight Protobuf %}
{% include proto/BatchNormParameter.txt %}
{% endhighlight %}
16 changes: 16 additions & 0 deletions docs/tutorial/layers/batchreindex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Batch Reindex Layer
---

# Batch Reindex Layer

* Layer type: `BatchReindex`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BatchReindexLayer.html)
* Header: [`./include/caffe/layers/batch_reindex_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/batch_reindex_layer.hpp)
* CPU implementation: [`./src/caffe/layers/batch_reindex_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_reindex_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/batch_reindex_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/batch_reindex_layer.cu)


## Parameters

No parameters.
19 changes: 19 additions & 0 deletions docs/tutorial/layers/bias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Bias Layer
---

# Bias Layer

* Layer type: `Bias`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BiasLayer.html)
* Header: [`./include/caffe/layers/bias_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/bias_layer.hpp)
* CPU implementation: [`./src/caffe/layers/bias_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bias_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/bias_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bias_layer.cu)

## Parameters
* Parameters (`BiasParameter bias_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/BiasParameter.txt %}
{% endhighlight %}
25 changes: 25 additions & 0 deletions docs/tutorial/layers/bnll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: BNLL Layer
---

# BNLL Layer

* Layer type: `BNLL`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BNLLLayer.html)
* Header: [`./include/caffe/layers/bnll_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/bnll_layer.hpp)
* CPU implementation: [`./src/caffe/layers/bnll_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/bnll_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/bnll_layer.cu`](https://github.com/BVLC/caffe/blob/master/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.

## Parameters
No parameters.

## Sample

layer {
name: "layer"
bottom: "in"
top: "out"
type: BNLL
}
40 changes: 40 additions & 0 deletions docs/tutorial/layers/concat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Concat Layer
---

# Concat Layer

* Layer type: `Concat`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ConcatLayer.html)
* Header: [`./include/caffe/layers/concat_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/concat_layer.hpp)
* CPU implementation: [`./src/caffe/layers/concat_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/concat_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/concat_layer.cu`](https://github.com/BVLC/caffe/blob/master/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 = 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.

## Parameters
* Parameters (`ConcatParameter concat_param`)
- Optional
- `axis` [default 1]: 0 for concatenation along num and 1 for channels.
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/ConcatParameter.txt %}
{% endhighlight %}
20 changes: 20 additions & 0 deletions docs/tutorial/layers/contrastiveloss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Contrastive Loss Layer
---

# Contrastive Loss Layer

* Layer type: `ContrastiveLoss`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ContrastiveLossLayer.html)
* Header: [`./include/caffe/layers/contrastive_loss_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/contrastive_loss_layer.hpp)
* CPU implementation: [`./src/caffe/layers/contrastive_loss_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/contrastive_loss_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/contrastive_loss_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/contrastive_loss_layer.cu)

## Parameters

* Parameters (`ContrastiveLossParameter contrastive_loss_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/ContrastiveLossParameter.txt %}
{% endhighlight %}
63 changes: 63 additions & 0 deletions docs/tutorial/layers/convolution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Convolution Layer
---

# Convolution Layer

* Layer type: `Convolution`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ConvolutionLayer.html)
* Header: [`./include/caffe/layers/conv_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/conv_layer.hpp)
* CPU implementation: [`./src/caffe/layers/conv_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/conv_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/conv_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/conv_layer.cu)
* Input
- `n * c_i * h_i * w_i`
* Output
- `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

Sample (as seen in [`./models/bvlc_reference_caffenet/train_val.prototxt`](https://github.com/BVLC/caffe/blob/master/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
}
}
}

## Parameters
* Parameters (`ConvolutionParameter convolution_param`)
- Required
- `num_output` (`c_o`): the number of filters
- `kernel_size` (or `kernel_h` and `kernel_w`): specifies height and width of each filter
- Strongly Recommended
- `weight_filler` [default `type: 'constant' value: 0`]
- Optional
- `bias_term` [default `true`]: specifies whether to learn and apply a set of additive biases to the filter outputs
- `pad` (or `pad_h` and `pad_w`) [default 0]: specifies the number of pixels to (implicitly) add to each side of the input
- `stride` (or `stride_h` and `stride_w`) [default 1]: specifies the intervals at which to apply the filters to the input
- `group` (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$$th output group channels will be only connected to the $$i$$th input group channels.
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/ConvolutionParameter.txt %}
{% endhighlight %}
20 changes: 20 additions & 0 deletions docs/tutorial/layers/crop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Crop Layer
---

# Crop Layer

* Layer type: `Crop`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1CropLayer.html)
* Header: [`./include/caffe/layers/crop_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/crop_layer.hpp)
* CPU implementation: [`./src/caffe/layers/crop_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/crop_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/crop_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/crop_layer.cu)

## Parameters

* Parameters (`CropParameter crop_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/CropParameter.txt %}
{% endhighlight %}
29 changes: 29 additions & 0 deletions docs/tutorial/layers/data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Database Layer
---

# Database Layer

* Layer type: `Data`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DataLayer.html)
* Header: [`./include/caffe/layers/data_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/data_layer.hpp)
* CPU implementation: [`./src/caffe/layers/data_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/data_layer.cpp)


## Parameters

* Parameters (`DataParameter data_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/DataParameter.txt %}
{% endhighlight %}

* Parameters
- Required
- `source`: the name of the directory containing the database
- `batch_size`: the number of inputs to process at one time
- Optional
- `rand_skip`: skip up to this number of inputs at the beginning; useful for asynchronous sgd
- `backend` [default `LEVELDB`]: choose whether to use a `LEVELDB` or `LMDB`

22 changes: 22 additions & 0 deletions docs/tutorial/layers/deconvolution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Deconvolution Layer
---

# Deconvolution Layer

* Layer type: `Deconvolution`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DeconvolutionLayer.html)
* Header: [`./include/caffe/layers/deconv_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/deconv_layer.hpp)
* CPU implementation: [`./src/caffe/layers/deconv_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/deconv_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/deconv_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/deconv_layer.cu)

## Parameters

Uses the same parameters as the Convolution layer.

* Parameters (`ConvolutionParameter convolution_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/ConvolutionParameter.txt %}
{% endhighlight %}
20 changes: 20 additions & 0 deletions docs/tutorial/layers/dropout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Dropout Layer
---

# Dropout Layer

* Layer type: `Dropout`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DropoutLayer.html)
* Header: [`./include/caffe/layers/dropout_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/dropout_layer.hpp)
* CPU implementation: [`./src/caffe/layers/dropout_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/dropout_layer.cpp)
* CUDA GPU implementation: [`./src/caffe/layers/dropout_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/dropout_layer.cu)

## Parameters

* Parameters (`DropoutParameter dropout_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/DropoutParameter.txt %}
{% endhighlight %}
20 changes: 20 additions & 0 deletions docs/tutorial/layers/dummydata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Dummy Data Layer
---

# Dummy Data Layer

* Layer type: `DummyData`
* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1DummyDataLayer.html)
* Header: [`./include/caffe/layers/dummy_data_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/dummy_data_layer.hpp)
* CPU implementation: [`./src/caffe/layers/dummy_data_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/dummy_data_layer.cpp)


## Parameters

* Parameters (`DummyDataParameter dummy_data_param`)
* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):

{% highlight Protobuf %}
{% include proto/DummyDataParameter.txt %}
{% endhighlight %}
Loading

0 comments on commit 6cbc72a

Please sign in to comment.