25template <
typename AFloat_t>
28template<
typename AFloat>
31 if (!fgRandomGen) fgRandomGen =
new TRandom3();
32 fgRandomGen->SetSeed(seed);
34template<
typename AFloat>
37 if (!fgRandomGen) fgRandomGen =
new TRandom3(0);
42template<
typename AFloat>
47 TRandom & rand = GetRandomGenerator();
49 AFloat
sigma = sqrt(2.0 / ((AFloat)
n));
51 for (
size_t i = 0; i < A.
GetSize(); ++i) {
60template<
typename AFloat>
66 TRandom & rand = GetRandomGenerator();
68 AFloat range = sqrt(2.0 / ((AFloat)
n));
74 for (
size_t i = 0; i < A.
GetSize(); ++i) {
84template<
typename AFloat>
93 TRandom & rand = GetRandomGenerator();
95 AFloat
sigma = sqrt(6.0 /( ((AFloat)
n) + ((AFloat)
m)) );
99 for (
size_t i = 0; i < nsize; i++) {
103 }
while (std::abs(value) > 2 *
sigma);
113template<
typename AFloat>
121 TRandom & rand = GetRandomGenerator();
123 AFloat range = sqrt(6.0 /( ((AFloat)
n) + ((AFloat)
m)) );
126 for (
size_t i = 0; i < nsize; i++) {
132template<
typename AFloat>
139 for (
size_t i = 0; i <
m; i++) {
140 for (
size_t j = 0; j <
n; j++) {
152template<
typename AFloat>
159 for (
size_t i = 0; i <
m; i++) {
160 for (
size_t j = 0; j <
n ; j++) {
166template <
typename AFloat>
171 for (
size_t i = 0; i <
n; i++) {
172 A.GetRawDataPointer()[i] = 0.0;
AFloat * GetRawDataPointer()
Return raw pointer to the elements stored contiguously in column-major order.
static TRandom * fgRandomGen
static void InitializeIdentity(Matrix_t &A)
static TRandom & GetRandomGenerator()
static void InitializeUniform(Matrix_t &A)
static void SetRandomSeed(size_t seed)
static void InitializeGauss(Matrix_t &A)
static void InitializeZero(Matrix_t &A)
static void InitializeGlorotUniform(Matrix_t &A)
Sample from a uniform distribution in range [ -lim,+lim] where lim = sqrt(6/N_in+N_out).
static void InitializeGlorotNormal(Matrix_t &A)
Truncated normal initialization (Glorot, called also Xavier normal) The values are sample with a norm...
Random number generator class based on M.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
create variable transformations