2using System.Collections.Generic;
73 public override void Fill(
int nCount,
long hMem,
int nNumAxes = 1,
int nNumOutputs = 1,
int nNumChannels = 1,
int nHeight = 1,
int nWidth = 1)
78 T[] rgData =
m_cuda.GetMemory(hMem);
79 int nF = (int)Math.Ceiling(nWidth / 2.0);
80 double dfC = (nWidth - 1) / (2.0 * nF);
82 for (
int i = 0; i < nCount; i++)
84 double dfX = i % nWidth;
85 double dfY = (i / nWidth) % nHeight;
86 double dfVal = (1 - Math.Abs(dfX / nF - dfC)) * (1 - Math.Abs(dfY / nF - dfC));
88 rgData[i] = (T)Convert.ChangeType(dfVal, typeof(T));
91 m_cuda.SetMemory(hMem, rgData);
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 CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
Fills a Blob with coefficients for bilinear interpolation.
override void Fill(int nCount, long hMem, int nNumAxes=1, int nNumOutputs=1, int nNumChannels=1, int nHeight=1, int nWidth=1)
Fill a memory with bilinear values.
BilinearFiller(CudaDnn< T > cuda, Log log, FillerParameter p)
Constructor.
Abstract Filler class used to fill blobs with values.
FillerParameter m_param
Specifies the filler parameters.
CudaDnn< T > m_cuda
Specifies the CudaDnn instance used to communicate to the low-level Cuda Dnn DLL.
Log m_log
Specifies the output log.
Specifies the filler parameters used to create each Filler.
int sparse
Specifies the sparcity value to use with the 'guassian' filler.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.fillers namespace contains all fillers including the Filler class.
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-...