2using System.Collections.Generic;
25 List<Layer<T>> m_rgIpLayers =
new List<Layer<T>>();
45 if (m_rgIpLayers !=
null)
47 foreach (
Layer<T> layer
in m_rgIpLayers)
91 int nOffset = (colBottom[0].num_axes == 2) ? 1 : 2;
92 int nDim = colBottom[0].count(0, nOffset);
94 int nCount = colBottom[0].count(nOffset);
95 int nSpatialDim = nCount / nNumInput;
96 List<int> rgShape =
new List<int>() { nDim, nSpatialDim };
100 m_rgIpBtm.
Add(blobBtm);
102 m_rgIpTop.
Add(colTop[0]);
104 for (
int i = 0; i < nNumInput; i++)
108 m_rgBtm.Add(blobBtm);
110 m_rgIpBtm[0] = m_rgBtm[i];
111 m_rgIpTop[0] = colTop[i];
118 m_rgIpLayers.Add(ip_layer);
134 m_rgIpBtm[0] = m_rgBtm[i];
135 m_rgIpTop[0] = colTop[i];
136 m_rgIpLayers[i].
Reshape(m_rgIpBtm, m_rgIpTop);
155 int nCount = m_rgBtm[i].count();
158 m_rgIpBtm[0] = m_rgBtm[i];
159 m_rgIpTop[0] = colTop[i];
160 m_rgIpLayers[i].Forward(m_rgIpBtm, m_rgIpTop);
183 m_rgIpBtm[0] = m_rgBtm[i];
184 m_rgIpTop[0] = colTop[i];
185 m_rgIpLayers[i].Backward(m_rgIpTop, rgbPropagateDown, m_rgIpBtm);
The Log class provides general output in text form.
The BlobCollection contains a list of Blobs.
void Add(Blob< T > b)
Add a new Blob to the collection.
int Count
Returns the number of items in the collection.
void Clear(bool bDispose=false)
Remove all items from the collection.
void Reshape(int[] rgShape)
Reshapes all blobs in the collection to the given shape.
The Blob is the main holder of data that moves through the Layers of the Net.
void Reshape(int nNum, int nChannels, int nHeight, int nWidth, bool? bUseHalfSize=null)
DEPRECIATED; use
The CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
An interface for the units of computation which can be composed into a Net.
Log m_log
Specifies the Log for output.
LayerParameter m_param
Specifies the LayerParameter describing the Layer.
abstract void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Performs Layer specific setup. Derived layers should override this function as well as the Reshape fu...
void Dispose()
Releases all GPU and host resources used by the Layer.
CudaDnn< T > m_cuda
Specifies the CudaDnn connection to Cuda.
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.
LayerParameter.LayerType m_type
Specifies the Layer type.
BlobCollection< T > blobs
Returns the collection of learnable parameter Blobs for the Layer.
LayerParameter convertLayerParam(LayerParameter pChild, LayerParameter pParent)
Called to convert a parent LayerParameterEx, used in blob sharing, with a child layer parameter.
int axis
Specifies the first axis to be lumped into a single inner product computation; all preceding axes are...
uint num_output
The number of outputs for the layer.
Specifies the base parameter for all layers.
string name
Specifies the name of this LayerParameter.
NumericTransformationParameter numeric_trans_param
Returns the parameter set when initialized with LayerType.NUMERIC_TRANS
InnerProductParameter inner_product_param
Returns the parameter set when initialized with LayerType.INNERPRODUCT
LayerType
Specifies the layer type.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
DIR
Defines the direction of data flow.
The MyCaffe.layers.tft namespace contains all TFT related layers.
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...