2using System.Collections.Generic;
31 public event EventHandler<ForwardArgs<T>>
OnReshape;
35 public event EventHandler<ForwardArgs<T>>
OnForward;
99 for (
int i = 0; i < colBottom.
Count && i < colTop.
Count; i++)
101 int nCount = colTop[i].count();
102 int nCountB = colBottom[i].count();
104 m_log.
CHECK_EQ(nCount, nCountB,
"The top and bottom at " + i.ToString() +
" must have the same number of items.");
106 long hBottomData = colBottom[i].gpu_data;
107 long hTopData = colTop[i].mutable_gpu_data;
109 m_cuda.copy(nCount, hBottomData, hTopData);
134 for (
int i = 0; i < colBottom.
Count && i < colTop.
Count; i++)
136 if (rgbPropagateDown[i])
138 int nCount = colTop[i].count();
139 int nCountB = colBottom[i].count();
141 m_log.
CHECK_EQ(nCount, nCountB,
"The top and bottom at " + i.ToString() +
" must have the same number of items.");
143 long hBottomDiff = colBottom[i].mutable_gpu_diff;
144 long hTopDiff = colTop[i].gpu_diff;
146 m_cuda.copy(nCount, hTopDiff, hBottomDiff);
The Log class provides general output in text form.
void CHECK_EQ(double df1, double df2, string str)
Test whether one number is equal to another.
The BackwardArgs are passed to the OnBackward event of the EventLayer.
The BlobCollection contains a list of Blobs.
int Count
Returns the number of items in the collection.
void ReshapeLike(BlobCollection< T > src)
Reshapes all blobs in the collection to the sizes of the source.
The CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
The ForwardArgs are passed to the OnForward event of the EventLayer.
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.
bool m_bUseHalfSize
Specifies that the half size of the top (if any) should be converted to the base size.
CudaDnn< T > m_cuda
Specifies the CudaDnn connection to Cuda.
LayerParameter.LayerType m_type
Specifies the Layer type.
The EventLayer provides an event that fires on the forward pass and another that fires on the backwar...
EventHandler< ForwardArgs< T > > OnLayerSetup
Defines the event that fires from within the LayerSetup function.
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Reshape the bottom (input) and top (output) blobs.
EventLayer(CudaDnn< T > cuda, Log log, LayerParameter p)
The EventLayer constructor.
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
Computes the error gradient w.r.t. the absolute value inputs.
override void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Setup the layer.
EventHandler< ForwardArgs< T > > OnReshape
Defines the event that fires from within the Reshape function.
override void forward(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Either fires the OnForward event, or acts as a pass-through.
EventHandler< BackwardArgs< T > > OnBackward
Defines the event that fires from within the backward pass.
EventHandler< ForwardArgs< T > > OnForward
Defines the event that fires from within the forward pass.
Specifies the base parameter for all layers.
bool use_halfsize
Specifies whether or not to use half sized memory or not.
LayerType
Specifies the layer type.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.layers.nt namespace contains all Neural Transfer 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-...