Apache SINGA
A distributed deep learning platform .
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Protected Attributes | List of all members
singa::ConvolutionLayer Class Reference

Convolution layer. More...

#include <neuron_layer.h>

Inheritance diagram for singa::ConvolutionLayer:
singa::NeuronLayer singa::Layer singa::CConvolutionLayer

Public Member Functions

void Setup (const LayerProto &proto, int npartitions) override
 Setup layer properties. More...
 
void ComputeFeature (int flag, Metric *perf) override
 Compute features of this layer based on connected layers. More...
 
void ComputeGradient (int flag, Metric *perf) override
 Compute gradients for parameters and connected layers. More...
 
const std::vector< Param * > GetParams () const override
 Layers that have paramters must override this function. More...
 
ConnectionType src_neuron_connection (int k) const override
 Return the connection type between one neuron of this layer and its source layer. More...
 
- Public Member Functions inherited from singa::Layer
virtual ConnectionType dst_layer_connection () const
 Return the connection type of this layer and all dst layers. More...
 
virtual const std::string DebugString (int step, int flag)
 For print debug info about each layer, e.g., norm of feature vector, norm of parameters. More...
 
int partition_dim () const
 
int partition_id () const
 
int type () const
 
const std::string & name () const
 Return name of this layer.
 
virtual const Blob< float > & data (const Layer *from) const
 
virtual Blob< float > * mutable_data (const Layer *from)
 
virtual const Blob< float > & grad (const Layer *from) const
 
virtual Blob< float > * mutable_grad (const Layer *from)
 
const std::vector< Layer * > srclayers () const
 return LayerS that connected to this layer
 
const std::vector< Layer * > dstlayers () const
 return LayerS that this layer connected to
 
int srclayers_size () const
 
int dstlayers_size () const
 
void clear_dstlayers ()
 
void clear_srclayers ()
 
void add_srclayer (Layer *src)
 
void add_dstlayer (Layer *dst)
 

Protected Attributes

int kernel_
 
int pad_
 
int stride_
 
int batchsize_
 
int channels_
 
int height_
 
int width_
 
int col_height_
 
int col_width_
 
int conv_height_
 
int conv_width_
 
int num_filters_
 
Paramweight_
 
Parambias_
 
Blob< float > col_data_
 
Blob< float > col_grad_
 
- Protected Attributes inherited from singa::Layer
LayerProto layer_proto_
 
Blob< float > data_
 
Blob< float > grad_
 
std::vector< Layer * > srclayers_
 
std::vector< Layer * > dstlayers_
 

Additional Inherited Members

- Static Public Member Functions inherited from singa::Layer
static LayerCreate (const LayerProto &proto)
 

Detailed Description

Convolution layer.

Member Function Documentation

void singa::ConvolutionLayer::ComputeFeature ( int  flag,
Metric perf 
)
overridevirtual

Compute features of this layer based on connected layers.

Parameters
perfpointer to Metric obj for collect and aggregate performance

Implements singa::Layer.

Reimplemented in singa::CConvolutionLayer.

void singa::ConvolutionLayer::ComputeGradient ( int  flag,
Metric perf 
)
overridevirtual

Compute gradients for parameters and connected layers.

Parameters
flagused to get the calling phase, e.g., forward of training (kForward | kTrain)
flagused to get the calling phase, e.g., forward of training

Implements singa::Layer.

Reimplemented in singa::CConvolutionLayer.

const std::vector<Param*> singa::ConvolutionLayer::GetParams ( ) const
inlineoverridevirtual

Layers that have paramters must override this function.

Parameters
flagused to get the calling phase, e.g., forward of training (kForward | kTrain)
Returns
parameters associated with this layer

Reimplemented from singa::Layer.

void singa::ConvolutionLayer::Setup ( const LayerProto &  proto,
int  npartitions 
)
overridevirtual

Setup layer properties.

Setup the shapes for data and parameters, also setup some properties based on the layer configuration and connected layers.

Parameters
protolayer configuration.
npartitionsnum of total partitions of the original layer. This layer should be setup as one partition.

Reimplemented from singa::Layer.

ConnectionType singa::ConvolutionLayer::src_neuron_connection ( int  k) const
inlineoverridevirtual

Return the connection type between one neuron of this layer and its source layer.

Currently support two connection types: kOneToOne, and kOneToAll. kOneToOne indicates the neuron depends on only one neuron from src layer. kOneToAll indicates the neuron depends on all neurons from src layer. TODO(wangwei) support kOneToMany.

Parameters
kindex of source layer (current only support k = 0.
connectiontype.

Reimplemented from singa::Layer.


The documentation for this class was generated from the following file: