2using System.Collections.Generic;
49 public override void Fill(
int nCount,
long hMem,
int nNumAxes = 1,
int nNumOutputs = 1,
int nNumChannels = 1,
int nHeight = 1,
int nWidth = 1)
51 m_log.
CHECK(nCount > 0,
"There is no data to fill!");
53 int nFanIn = nCount / nNumOutputs;
55 int nFanOut = nNumAxes > 1 ?
56 nCount / nNumChannels :
61 dfN = (nFanIn + nFanOut) / 2.0;
65 double dfScale = Math.Sqrt(3.0 / dfN);
66 T fPosScale = (T)Convert.ChangeType(dfScale, typeof(T));
67 T fNegScale = (T)Convert.ChangeType(-dfScale, typeof(T));
68 m_cuda.rng_uniform(nCount, fNegScale, fPosScale, hMem);
The Log class provides general output in text form.
void CHECK(bool b, string str)
Test a flag for true.
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.
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.
Fills a Blob with values where is set inversely proportional to number of incoming nodes,...
XavierFiller(CudaDnn< T > cuda, Log log, FillerParameter p)
Constructor.
override void Fill(int nCount, long hMem, int nNumAxes=1, int nNumOutputs=1, int nNumChannels=1, int nHeight=1, int nWidth=1)
Fill the memory with random numbers from a xavier distribution.
Specifies the filler parameters used to create each Filler.
int sparse
Specifies the sparcity value to use with the 'guassian' filler.
VarianceNorm
Defines the variance normalization.
VarianceNorm variance_norm
Specifies the variance normalization method to use with the 'xavier' and 'mrsa' fillers.
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-...