Adds new layer to the net
id = net.addLayer(name, layerType, params)
Input
- name unique name of the adding layer.
- layerType typename of the adding layer (type must be
registered).
- params parameters which will be used to initialize the
creating layer. Scalar structure with the following fields:
- dict name-value dictionary as struct, values are scalar
values (or arrays) of one of the following type: double,
integer, or string.
- blobs List of learned parameters stored as blobs.
- name Name of the layer instance (optional, can be used
internal purposes).
- type Type name which was used for creating layer by
layer factory (optional).
Output
- id unique identifier of created layer, or -1 if a failure
will happen.
A LayerParams provides all data needed to initialize layer. It
includes dictionary with scalar params (params.dict
struct),
blob params params.blobs
and optional meta information
params.name
and params.type
of layer instance.
Built-in layers listed below partially reproduce functionality
of corresponding Caffe and Torch7 layers. In partuclar, the
following layers and Caffe importer were tested to reproduce
Caffe
functionality:
- Convolution
- Deconvolution
- Pooling
- InnerProduct
- TanH, ReLU, Sigmoid, BNLL, Power, AbsVal
- Softmax
- Reshape, Flatten, Slice, Split
- LRN
- MVN
- Dropout (since it does nothing on forward pass)