MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.layers.BaseConvolutionLayer< T > Class Template Referenceabstract

The BaseConvolutionLayer is an abstract base class that factors out BLAS code common to ConvolutionLayer and DeconvolutionLayer More...

Inheritance diagram for MyCaffe.layers.BaseConvolutionLayer< T >:
MyCaffe.layers.Layer< T > MyCaffe.layers.ConvolutionLayer< T > MyCaffe.layers.DeconvolutionLayer< T >

Public Member Functions

 BaseConvolutionLayer (CudaDnn< T > cuda, Log log, LayerParameter p)
 The BaseConvolutionLayer constructor. More...
 
override bool ReInitializeParameters (WEIGHT_TARGET target)
 Re-initialize the parameters of the layer. More...
 
override void LayerSetUp (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Setup the layer. More...
 
override void Reshape (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Reshape the bottom (input) and top (output) blobs. More...
 
- Public Member Functions inherited from MyCaffe.layers.Layer< T >
 Layer (CudaDnn< T > cuda, Log log, LayerParameter p)
 The Layer constructor. More...
 
void Dispose ()
 Releases all GPU and host resources used by the Layer. More...
 
virtual void ConnectLoss (LossLayer< T > layer)
 Called to connect the loss OnLoss event to a specified layer (typically the data layer). More...
 
virtual BlobCollection< T > PreProcessInput (PropertySet customInput, out int nSeqLen, BlobCollection< T > colBottom=null)
 The PreprocessInput allows derivative data layers to convert a property set of input data into the bottom blob collection used as intput. More...
 
virtual bool PreProcessInput (string strEncInput, int? nDecInput, BlobCollection< T > colBottom)
 Preprocess the input data for the RUN phase. More...
 
virtual List< Tuple< string, int, double > > PostProcessOutput (Blob< T > blobSofmtax, int nK=1)
 The PostProcessOutput allows derivative data layers to post-process the results, converting them back into text results (e.g., detokenizing). More...
 
virtual List< Tuple< string, int, double > > PostProcessLogitsOutput (int nCurIdx, Blob< T > blobLogits, Layer< T > softmax, int nAxis, int nK=1)
 The PostProcessLogitsOutput allows derivative data layers to post-process the results, converting them back into text results (e.g., detokenizing). More...
 
virtual string PostProcessFullOutput (Blob< T > blobSoftmax)
 The PostProcessFullOutput allows derivative data layers to post-process the results, usually be detokenizing the data in the blobSoftmax. More...
 
virtual string PostProcessOutput (int nIdx)
 Convert the index to the word. More...
 
virtual void SetOnDebug (EventHandler< GetWorkBlobArgs< T > > fn)
 Set the OnDebug event. More...
 
virtual void ResetOnDebug (EventHandler< GetWorkBlobArgs< T > > fn)
 Reset the OnDebug event, disabling it. More...
 
void SetNetReshapeRequest ()
 Called by the Net when requesting a reshape. More...
 
void SetPhase (Phase phase)
 Changes the layer's Phase to the one specified. More...
 
void Setup (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Implements common Layer setup functionality. More...
 
virtual void SetNetParameterUsed (NetParameter np)
 This function allows other layers to gather needed information from the NetParameters if any, and is called when initialzing the Net. More...
 
void ConvertToBase (BlobCollection< T > col)
 ConvertToBase converts any blobs in a collection that are in half size to the base size. More...
 
double Forward (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Given the bottom (input) Blobs, this function computes the top (output) Blobs and the loss. More...
 
void Backward (BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
 Given the top Blob error gradients, compute the bottom Blob error gradients. More...
 
double loss (int nTopIdx)
 Returns the scalar loss associated with the top Blob at a given index. More...
 
void set_loss (int nTopIdx, double dfLoss)
 Sets the loss associated with a top Blob at a given index. More...
 
virtual bool AllowForceBackward (int nBottomIdx)
 Return whether to allow More...
 
bool param_propagate_down (int nParamIdx)
 Returns whether or not the Layer should compute gradients w.r.t. a parameter at a particular index given by a parameter index. More...
 
void set_param_propagate_down (int nParamIdx, bool bPropagate)
 Sets whether or not the Layer should compute gradients w.r.t. a parameter at a particular index given by a parameter index. More...
 
void SetEnablePassthrough (bool bEnable)
 Enables/disables the pass-through mode. More...
 

Protected Member Functions

override void dispose ()
 Releases all GPU and host resources used by the Layer. More...
 
ulong getWorkspaceLimitInBytes (bool bUseTensorCores=false)
 Returns the workspace limit in bytes based on the cudnn_workspace_limit setting. More...
 
override void setup_internal_blobs (BlobCollection< T > col)
 Derivative layers should add all internal blobws to the 'col' provided. More...
 
override WorkspaceArgs getWorkspace ()
 Retruns the WorkspaceArgs containing the workspace used by this Layer. More...
 
override bool setWorkspace (ulong lSizeInBytes)
 If not already set, allocates the workspace needed in GPU memory. More...
 
void forward_gemm (long hInput, int nInputOffset, long hWeights, long hOutput, int nOutputOffset, bool bSkipIm2Col=false)
 Helper function that abstract away the column buffer and gemm arguments. More...
 
void forward_bias (long hOutput, int nOutputOffset, long hBias)
 Helper function that abstracts away the column buffer and gemm arguments. More...
 
void backward_gemm (long hOutput, int nOutputOffset, long hWeights, long hInput, int nInputOffset)
 Helper function that abstract away the column buffer and gemm arguments. More...
 
void weight_gemm (long hInput, int nInputOffset, long hOutput, int nOutputOffset, long hWeights)
 Helper function that abstract away the column buffer and gemm arguments. More...
 
void backward_bias (long hBias, long hInput, int nInputOffset)
 Helper function that abstracts away the column buffer and gemm arguments. More...
 
int input_shape (int i)
 Returns the spatial dimensions of the input. More...
 
abstract bool reverse_dimensions ()
 reverse_dimensions should return true iff we are implementing deconv, so that conv helpers know which dimensions to use. More...
 
abstract void compute_output_shape ()
 Compute height_out and width_out from other parameters. More...
 
- Protected Member Functions inherited from MyCaffe.layers.Layer< T >
void dispose (ref Layer< T > l)
 Helper method used to dispose internal layers. More...
 
void dispose (ref Blob< T > b)
 Helper method used to dispose internal blobs. More...
 
void dispose (ref BlobCollection< T > rg, bool bSetToNull=true)
 Dispose the blob collection. More...
 
GetIterationArgs getCurrentIteration ()
 Fires the OnGetIteration event to query the current iteration. More...
 
long convert_to_full (int nCount, long hMem)
 Convert half memory to full memory. More...
 
void convert (BlobCollection< T > col)
 Convert a collection of blobs from / to half size. More...
 
virtual bool reshapeNeeded (BlobCollection< T > colBottom, BlobCollection< T > colTop, bool bReset=true)
 Tests the shapes of both the bottom and top blobs and if they are the same as the previous sizing, returns false indicating that no reshape is needed. More...
 
bool compareShapes (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Compare the shapes of the top and bottom and if the same, return true, otherwise false. More...
 
void setShapes (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Set the internal shape sizes - used when determining if a Reshape is necessary. More...
 
abstract void forward (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 This forward abstract function must be overriden by each derived Layer class to compute the top (output) Blobs for this layer. More...
 
abstract void backward (BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
 This backward abstract function must be overriden by each derived Layer class to compute the bottom (intput) Blob diffs for this Layer. More...
 
void CheckBlobCounts (BlobCollection< T > colBottom, BlobCollection< T > colTop)
 Called by the Layer::Setup function to check the number of bottom (input) and top (output) Blobs provided match the expected number of blobs expected via the {EactNum,Min,Max}{Bottom,Top}Blobs functions. More...
 
void SetLossWeights (BlobCollection< T > colTop)
 Called by Layer::Setup to initialize the weights associated with any top (output) Blobs in the loss function ans store non-zero loss weights in the diff Blob. More...
 
LayerParameter convertLayerParam (LayerParameter pChild, LayerParameter pParent)
 Called to convert a parent LayerParameterEx, used in blob sharing, with a child layer parameter. More...
 
bool shareParameter (Blob< T > b, List< int > rgMinShape, bool bAllowEndsWithComparison=false)
 Attempts to share a parameter Blob if another parameter Blob with the same name and accpetable size is found. More...
 
bool shareLayerBlob (Blob< T > b, List< int > rgMinShape)
 Attempts to share a Layer Blob if another parameter Blob with the same name and acceptable size is found. More...
 
bool shareLayerBlobs (Layer< T > layer)
 Attempts to share the Layer blobs and internal_blobs with matching names and sizes with those in another matching layer. More...
 
void check_nan (Blob< T > b)
 Checks a Blob for NaNs and throws an exception if found. More...
 
convert (double df)
 Converts a double to a generic. More...
 
convert (float f)
 Converts a float to a generic. More...
 
double convertD (T df)
 Converts a generic to a double value. More...
 
float convertF (T df)
 Converts a generic to a float value. More...
 
double[] convertD (T[] rg)
 Converts an array of generic values into an array of double values. More...
 
T[] convert (double[] rg)
 Converts an array of double values into an array of generic values. More...
 
float[] convertF (T[] rg)
 Converts an array of float values into an array of generic values. More...
 
T[] convert (float[] rg)
 Converts an array of float values into an array of generic values. More...
 
int val_at (T[] rg, int nIdx)
 Returns the integer value at a given index in a generic array. More...
 
Size size_at (Blob< T > b)
 Returns the Size of a given two element Blob, such as one that stores Blob size information. More...
 

Protected Attributes

Blob< T > m_blobKernelShape
 The spatial dimensions of the filter kernel. More...
 
Blob< T > m_blobStride
 The spatial dimensions of the stride. More...
 
Blob< T > m_blobPad
 The spatial dimensions of the padding. More...
 
Blob< T > m_blobDilation
 The spatial dimentions of the dilation. More...
 
Blob< T > m_blobConvInputShape
 The spatial dimensions of the convolution input. More...
 
List< int > m_rgColBufferShape
 The spatial dimensionss of the col_buffer. More...
 
List< int > m_rgOutputShape = new List<int>()
 The spatial dimensions of the output. More...
 
List< int > m_rgBottomShape = new List<int>()
 The buttom shape. More...
 
int m_nNumSpatialAxes
 The number of spatial axes. More...
 
int m_nBottomDim
 The bottom dimension. More...
 
int m_nTopDim
 The top dimension. More...
 
int m_nChannelAxis
 The channel axis. More...
 
int m_nNum
 The number of items in the batch. More...
 
int m_nChannels
 The number of channels in each item. More...
 
int m_nGroup
 The group. More...
 
int m_nOutSpatialDim
 The output spatial dimension. More...
 
int m_nWeightOffset
 The weight offset used. More...
 
int m_nNumOutput
 The number of outputs. More...
 
bool m_bBiasTerm
 Whether or not to use bias. More...
 
bool m_bIs1x1
 Whether or not the kernel is 1x1. More...
 
bool m_bForceNDim2col
 Whether or not to force n-dim 2 column. More...
 
- Protected Attributes inherited from MyCaffe.layers.Layer< T >
LayerParameter.LayerType m_type = LayerParameter.LayerType._MAX
 Specifies the Layer type. More...
 
CudaDnn< T > m_cuda
 Specifies the CudaDnn connection to Cuda. More...
 
Log m_log
 Specifies the Log for output. More...
 
LayerParameter m_param
 Specifies the LayerParameter describing the Layer. More...
 
Phase m_phase
 Specifies the Phase under which the Layer is run. More...
 
BlobCollection< T > m_colBlobs
 Specifies the learnable parameter Blobs of the Layer. More...
 
BlobCollection< T > m_colInternalBlobs = new BlobCollection<T>()
 Specifies internal blobs used by the layer. More...
 
DictionaryMap< bool > m_rgbParamPropagateDown
 Specifies whether or not to compute the learnable diff of each parameter Blob. More...
 
DictionaryMap< double > m_rgLoss
 Specifies the loss values that indeicate whether each top (output) Blob has a non-zero weight in the objective function.. More...
 
m_tOne
 Specifies a generic type equal to 1.0. More...
 
m_tZero
 Specifies a generic type equal to 0.0. More...
 
bool m_bEnablePassthrough = false
 Enables/disables the pass-through mode for the layer. Default = false. More...
 
bool m_bUseHalfSize = false
 Specifies that the half size of the top (if any) should be converted to the base size. More...
 
bool m_bConvertTopOnFwd = false
 Specifies whether or not the layer should convert the top on the forward pass when using half sized memory (typically only done with input data). More...
 
bool m_bConvertTopOnBwd = true
 Specifies whether or not to convert the top on the backward pass when using half sized memory (typically not done on loss layers). More...
 
bool m_bConvertBottom = true
 Specifies whether or not the layer should convert the bottom when using half sized memory. More...
 
bool m_bReshapeOnForwardNeeded = true
 Specifies whether or not the reshape on forward is needed or not. More...
 
bool m_bNetReshapeRequest = false
 Specifies whether the reshape is requested from a Net.Reshape call or not. More...
 
LayerParameter.? LayerType m_parentLayerType = null
 Specifies the layer type of the parent. More...
 

Properties

override int MinBottomBlobs [get]
 Returns the minimum number of required bottom Blobs: input More...
 
override int MinTopBlobs [get]
 Returns the minimum number of required top (output) Blobs: output More...
 
override bool EqualNumBottomTopBlobs [get]
 Returns that there are an equal number of top and bottom Blobs. More...
 
- Properties inherited from MyCaffe.layers.Layer< T >
LayerParameter.? LayerType parent_layer_type [get]
 Optionally, specifies the parent layer type (e.g. LOSS, etc.) More...
 
virtual bool SupportsPreProcessing [get]
 Should return true when PreProcessing methods are overriden. More...
 
virtual bool SupportsPostProcessing [get]
 Should return true when pre PostProcessing methods are overriden. More...
 
virtual bool SupportsPostProcessingLogits [get]
 Should return true when pre PostProcessingLogits methods are overriden. More...
 
virtual bool SupportsPostProcessingFullOutput [get]
 Should return true when PostProcessingFullOutput is supported. More...
 
BlobCollection< T > blobs [get]
 Returns the collection of learnable parameter Blobs for the Layer. More...
 
BlobCollection< T > internal_blobs [get]
 Returns the collection of internal Blobs used by the Layer. More...
 
LayerParameter layer_param [get]
 Returns the LayerParameter for this Layer. More...
 
LayerParameter.LayerType type [get]
 Returns the LayerType of this Layer. More...
 
virtual int ExactNumBottomBlobs [get]
 Returns the exact number of bottom (input) Blobs required by the Layer, or -1 if no exact number is required. More...
 
virtual int MinBottomBlobs [get]
 Returns the minimum number of bottom (input) Blobs required by the Layer, or -1 if no minimum number is required. More...
 
virtual int MaxBottomBlobs [get]
 Returns the maximum number of bottom (input) Blobs required by the Layer, or -1 if no maximum number is required. More...
 
virtual int ExactNumTopBlobs [get]
 Returns the exact number of top (output) Blobs required by the Layer, or -1 if no exact number is required. More...
 
virtual int MinTopBlobs [get]
 Returns the minimum number of top (output) Blobs required by the Layer, or -1 if no minimum number is required. More...
 
virtual int MaxTopBlobs [get]
 Returns the maximum number of top (output) Blobs required by the Layer, or -1 if no maximum number is required. More...
 
virtual bool EqualNumBottomTopBlobs [get]
 Returns true if the Layer requires and equal number of bottom (input) and top (output) Blobs. More...
 
virtual bool AutoTopBlobs [get]
 Return whether "anonymous" top (output) Blobs are created automatically by the Layer. More...
 
double forward_timing [get]
 Returns the timing of the last forward pass in milliseconds. More...
 
double forward_timing_average [get]
 Returns the average timing of the forward passes in milliseconds. More...
 
double backward_timing [get]
 Returns the timing of the last backward pass in milliseconds. More...
 
double backward_timing_average [get]
 Returns the average timing of the backward passes in milliseconds. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MyCaffe.layers.Layer< T >
static Layer< T > Create (CudaDnn< T > cuda, Log log, LayerParameter p, CancelEvent evtCancel, IXDatabaseBase db=null, TransferInput trxinput=null)
 Create a new Layer based on the LayerParameter. More...
 
- Events inherited from MyCaffe.layers.Layer< T >
EventHandler< WorkspaceArgsOnGetWorkspace
 Specifies the OnGetWorkspace event that fires when the getWorkspace() function is called by a layer to get a shareable workspace to conserve GPU memory. More...
 
EventHandler< WorkspaceArgsOnSetWorkspace
 Specifies the OnSetWorkspace event that fires when the setWorkspace() function is called by a layer to get a shareable workspace to conserve GPU memory. More...
 
EventHandler< GetIterationArgsOnGetIteration
 Specifies the OnGetIteration event that fires when a layer needs to get the current iteration from the solver. More...
 
EventHandler< GetWorkBlobArgs< T > > OnDebug
 Specifies the OnGetWorkBlob event that is only supported when debugging to get a work blob from the primary Net holding this layer. More...
 

Detailed Description

The BaseConvolutionLayer is an abstract base class that factors out BLAS code common to ConvolutionLayer and DeconvolutionLayer

Template Parameters
TSpecifies the base type float or double. Using float is recommended to conserve GPU memory.

Definition at line 17 of file BaseConvolutionLayer.cs.

Constructor & Destructor Documentation

◆ BaseConvolutionLayer()

The BaseConvolutionLayer constructor.

Parameters
cudaSpecifies the CudaDnn connection to Cuda.
logSpecifies the Log for output.
pSpecifies the LayerParameter.

Definition at line 127 of file BaseConvolutionLayer.cs.

Member Function Documentation

◆ backward_bias()

void MyCaffe.layers.BaseConvolutionLayer< T >.backward_bias ( long  hBias,
long  hInput,
int  nInputOffset 
)
protected

Helper function that abstracts away the column buffer and gemm arguments.

This function is only used when performing the Caffe version of convolution.

Parameters
hBiasSpecifies a handle to the bias data in GPU memory.
hInputSpecifies a handle to the input data in GPU memory.
nInputOffsetSpecifies an offset (in items) into the input data.

Definition at line 840 of file BaseConvolutionLayer.cs.

◆ backward_gemm()

void MyCaffe.layers.BaseConvolutionLayer< T >.backward_gemm ( long  hOutput,
int  nOutputOffset,
long  hWeights,
long  hInput,
int  nInputOffset 
)
protected

Helper function that abstract away the column buffer and gemm arguments.

This function is only used when performing the Caffe version of convolution.

Parameters
hOutputSpecifies a handle to the output data in GPU memory.
nOutputOffsetSpecifies an offset (in items) into the output data.
hWeightsSpecifies a handle to the weight data in GPU memory.
hInputSpecifies a handle to the input data in GPU memory.
nInputOffsetSpecifies an offset (in items) into the input data.

Definition at line 778 of file BaseConvolutionLayer.cs.

◆ compute_output_shape()

abstract void MyCaffe.layers.BaseConvolutionLayer< T >.compute_output_shape ( )
protectedpure virtual

Compute height_out and width_out from other parameters.

Implemented in MyCaffe.layers.ConvolutionLayer< T >, and MyCaffe.layers.DeconvolutionLayer< T >.

◆ dispose()

override void MyCaffe.layers.BaseConvolutionLayer< T >.dispose ( )
protectedvirtual

Releases all GPU and host resources used by the Layer.

Reimplemented from MyCaffe.layers.Layer< T >.

Reimplemented in MyCaffe.layers.ConvolutionLayer< T >, and MyCaffe.layers.DeconvolutionLayer< T >.

Definition at line 153 of file BaseConvolutionLayer.cs.

◆ forward_bias()

void MyCaffe.layers.BaseConvolutionLayer< T >.forward_bias ( long  hOutput,
int  nOutputOffset,
long  hBias 
)
protected

Helper function that abstracts away the column buffer and gemm arguments.

This function is only used when performing the Caffe version of convolution.

Parameters
hOutputSpecifies a handle to the output data in GPU memory.
nOutputOffsetSpecifies an offset (in items) into the output data.
hBiasSpecifies a handle to the bias data in GPU memory.

Definition at line 762 of file BaseConvolutionLayer.cs.

◆ forward_gemm()

void MyCaffe.layers.BaseConvolutionLayer< T >.forward_gemm ( long  hInput,
int  nInputOffset,
long  hWeights,
long  hOutput,
int  nOutputOffset,
bool  bSkipIm2Col = false 
)
protected

Helper function that abstract away the column buffer and gemm arguments.

This function is only used when performing the Caffe version of convolution.

Parameters
hInputSpecifies a handle to the input data in GPU memory.
nInputOffsetSpecifies an offset (in items) into the input data.
hWeightsSpecifies a handle to the weight data in GPU memory.
hOutputSpecifies a handle to the output data in GPU memory.
nOutputOffsetSpecifies an offset (in items) into the output data.
bSkipIm2ColSpecifies whether or not to skip the im2coll function call for it was already computed.

Definition at line 735 of file BaseConvolutionLayer.cs.

◆ getWorkspace()

override WorkspaceArgs MyCaffe.layers.BaseConvolutionLayer< T >.getWorkspace ( )
protectedvirtual

Retruns the WorkspaceArgs containing the workspace used by this Layer.

Returns

Reimplemented from MyCaffe.layers.Layer< T >.

Definition at line 230 of file BaseConvolutionLayer.cs.

◆ getWorkspaceLimitInBytes()

ulong MyCaffe.layers.BaseConvolutionLayer< T >.getWorkspaceLimitInBytes ( bool  bUseTensorCores = false)
protected

Returns the workspace limit in bytes based on the cudnn_workspace_limit setting.

Parameters
bUseTensorCoresSpecifies whether or not tensor cores are to be used and when they are we let cuDNN determine the workspace size.

The following cudnn_workspace_limits are used as follows: 0 = no workspace used. -1 = let CUDA choose fastest algorithm and workspace size. value = use the value specified * 16.

Returns
The workspace limit in bytes is returned.

Definition at line 187 of file BaseConvolutionLayer.cs.

◆ input_shape()

int MyCaffe.layers.BaseConvolutionLayer< T >.input_shape ( int  i)
protected

Returns the spatial dimensions of the input.

Parameters
iSpecifies the index to add to the channel index.
Returns
The spatial dimension at the index is returned.

Definition at line 850 of file BaseConvolutionLayer.cs.

◆ LayerSetUp()

override void MyCaffe.layers.BaseConvolutionLayer< T >.LayerSetUp ( BlobCollection< T >  colBottom,
BlobCollection< T >  colTop 
)
virtual

Setup the layer.

Parameters
colBottomSpecifies the collection of bottom (input) Blobs.
colTopSpecifies the collection of top (output) Blobs.

Implements MyCaffe.layers.Layer< T >.

Reimplemented in MyCaffe.layers.ConvolutionLayer< T >, and MyCaffe.layers.DeconvolutionLayer< T >.

Definition at line 299 of file BaseConvolutionLayer.cs.

◆ ReInitializeParameters()

override bool MyCaffe.layers.BaseConvolutionLayer< T >.ReInitializeParameters ( WEIGHT_TARGET  target)
virtual

Re-initialize the parameters of the layer.

Parameters
targetSpecifies the weights to target (e.g. weights, bias or both).
Returns
When handled, this method returns true, otherwise false.

Reimplemented from MyCaffe.layers.Layer< T >.

Definition at line 275 of file BaseConvolutionLayer.cs.

◆ Reshape()

override void MyCaffe.layers.BaseConvolutionLayer< T >.Reshape ( BlobCollection< T >  colBottom,
BlobCollection< T >  colTop 
)
virtual

Reshape the bottom (input) and top (output) blobs.

Parameters
colBottomSpecifies the collection of bottom (input) Blobs.
colTopSpecifies the collection of top (output) Blobs.

Implements MyCaffe.layers.Layer< T >.

Reimplemented in MyCaffe.layers.ConvolutionLayer< T >, and MyCaffe.layers.DeconvolutionLayer< T >.

Definition at line 597 of file BaseConvolutionLayer.cs.

◆ reverse_dimensions()

abstract bool MyCaffe.layers.BaseConvolutionLayer< T >.reverse_dimensions ( )
protectedpure virtual

reverse_dimensions should return true iff we are implementing deconv, so that conv helpers know which dimensions to use.

Returns
If the dimensions are to be reversed (e.g. when deconvolving), true is returned, otherwise false is returned.

Implemented in MyCaffe.layers.ConvolutionLayer< T >, and MyCaffe.layers.DeconvolutionLayer< T >.

◆ setup_internal_blobs()

override void MyCaffe.layers.BaseConvolutionLayer< T >.setup_internal_blobs ( BlobCollection< T >  col)
protectedvirtual

Derivative layers should add all internal blobws to the 'col' provided.

Parameters
colSpecifies the blob collection where internal blobs are added.

Reimplemented from MyCaffe.layers.Layer< T >.

Definition at line 214 of file BaseConvolutionLayer.cs.

◆ setWorkspace()

override bool MyCaffe.layers.BaseConvolutionLayer< T >.setWorkspace ( ulong  lSizeInBytes)
protectedvirtual

If not already set, allocates the workspace needed in GPU memory.

Parameters
lSizeInBytesSpecifies the size (in bytes) of workspace needed.
Returns
This method always returns true.

Reimplemented from MyCaffe.layers.Layer< T >.

Definition at line 246 of file BaseConvolutionLayer.cs.

◆ weight_gemm()

void MyCaffe.layers.BaseConvolutionLayer< T >.weight_gemm ( long  hInput,
int  nInputOffset,
long  hOutput,
int  nOutputOffset,
long  hWeights 
)
protected

Helper function that abstract away the column buffer and gemm arguments.

This function is only used when performing the Caffe version of convolution.

Parameters
hInputSpecifies a handle to the input data in GPU memory.
nInputOffsetSpecifies an offset (in items) into the input data.
hOutputSpecifies a handle to the output data in GPU memory.
nOutputOffsetSpecifies an offset (in items) into the output data.
hWeightsSpecifies a handle to the weight data in GPU memory.

Definition at line 811 of file BaseConvolutionLayer.cs.

Member Data Documentation

◆ m_bBiasTerm

bool MyCaffe.layers.BaseConvolutionLayer< T >.m_bBiasTerm
protected

Whether or not to use bias.

Definition at line 94 of file BaseConvolutionLayer.cs.

◆ m_bForceNDim2col

bool MyCaffe.layers.BaseConvolutionLayer< T >.m_bForceNDim2col
protected

Whether or not to force n-dim 2 column.

Definition at line 102 of file BaseConvolutionLayer.cs.

◆ m_bIs1x1

bool MyCaffe.layers.BaseConvolutionLayer< T >.m_bIs1x1
protected

Whether or not the kernel is 1x1.

Definition at line 98 of file BaseConvolutionLayer.cs.

◆ m_blobConvInputShape

Blob<T> MyCaffe.layers.BaseConvolutionLayer< T >.m_blobConvInputShape
protected

The spatial dimensions of the convolution input.

Definition at line 38 of file BaseConvolutionLayer.cs.

◆ m_blobDilation

Blob<T> MyCaffe.layers.BaseConvolutionLayer< T >.m_blobDilation
protected

The spatial dimentions of the dilation.

Definition at line 34 of file BaseConvolutionLayer.cs.

◆ m_blobKernelShape

Blob<T> MyCaffe.layers.BaseConvolutionLayer< T >.m_blobKernelShape
protected

The spatial dimensions of the filter kernel.

Definition at line 22 of file BaseConvolutionLayer.cs.

◆ m_blobPad

Blob<T> MyCaffe.layers.BaseConvolutionLayer< T >.m_blobPad
protected

The spatial dimensions of the padding.

Definition at line 30 of file BaseConvolutionLayer.cs.

◆ m_blobStride

Blob<T> MyCaffe.layers.BaseConvolutionLayer< T >.m_blobStride
protected

The spatial dimensions of the stride.

Definition at line 26 of file BaseConvolutionLayer.cs.

◆ m_nBottomDim

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nBottomDim
protected

The bottom dimension.

Definition at line 58 of file BaseConvolutionLayer.cs.

◆ m_nChannelAxis

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nChannelAxis
protected

The channel axis.

Definition at line 66 of file BaseConvolutionLayer.cs.

◆ m_nChannels

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nChannels
protected

The number of channels in each item.

Definition at line 74 of file BaseConvolutionLayer.cs.

◆ m_nGroup

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nGroup
protected

The group.

Definition at line 78 of file BaseConvolutionLayer.cs.

◆ m_nNum

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nNum
protected

The number of items in the batch.

Definition at line 70 of file BaseConvolutionLayer.cs.

◆ m_nNumOutput

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nNumOutput
protected

The number of outputs.

Definition at line 90 of file BaseConvolutionLayer.cs.

◆ m_nNumSpatialAxes

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nNumSpatialAxes
protected

The number of spatial axes.

Definition at line 54 of file BaseConvolutionLayer.cs.

◆ m_nOutSpatialDim

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nOutSpatialDim
protected

The output spatial dimension.

Definition at line 82 of file BaseConvolutionLayer.cs.

◆ m_nTopDim

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nTopDim
protected

The top dimension.

Definition at line 62 of file BaseConvolutionLayer.cs.

◆ m_nWeightOffset

int MyCaffe.layers.BaseConvolutionLayer< T >.m_nWeightOffset
protected

The weight offset used.

Definition at line 86 of file BaseConvolutionLayer.cs.

◆ m_rgBottomShape

List<int> MyCaffe.layers.BaseConvolutionLayer< T >.m_rgBottomShape = new List<int>()
protected

The buttom shape.

Definition at line 50 of file BaseConvolutionLayer.cs.

◆ m_rgColBufferShape

List<int> MyCaffe.layers.BaseConvolutionLayer< T >.m_rgColBufferShape
protected

The spatial dimensionss of the col_buffer.

Definition at line 42 of file BaseConvolutionLayer.cs.

◆ m_rgOutputShape

List<int> MyCaffe.layers.BaseConvolutionLayer< T >.m_rgOutputShape = new List<int>()
protected

The spatial dimensions of the output.

Definition at line 46 of file BaseConvolutionLayer.cs.

Property Documentation

◆ EqualNumBottomTopBlobs

override bool MyCaffe.layers.BaseConvolutionLayer< T >.EqualNumBottomTopBlobs
get

Returns that there are an equal number of top and bottom Blobs.

Definition at line 718 of file BaseConvolutionLayer.cs.

◆ MinBottomBlobs

override int MyCaffe.layers.BaseConvolutionLayer< T >.MinBottomBlobs
get

Returns the minimum number of required bottom Blobs: input

Definition at line 702 of file BaseConvolutionLayer.cs.

◆ MinTopBlobs

override int MyCaffe.layers.BaseConvolutionLayer< T >.MinTopBlobs
get

Returns the minimum number of required top (output) Blobs: output

Definition at line 710 of file BaseConvolutionLayer.cs.


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