25 template <
typename Real_t>
28 template<
typename Real_t>
31 if (!fgRandomGen) fgRandomGen =
new TRandom3();
32 fgRandomGen->SetSeed(seed);
34 template<
typename Real_t>
37 if (!fgRandomGen) fgRandomGen =
new TRandom3(0);
42 template<
typename Real_t>
49 TRandom & rand = GetRandomGenerator();
53 for (
size_t i = 0; i <
m; i++) {
54 for (
size_t j = 0; j <
n; j++) {
55 A(i,j) = rand.
Gaus(0.0, sigma);
61 template<
typename Real_t>
68 TRandom & rand = GetRandomGenerator();
72 for (
size_t i = 0; i <
m; i++) {
73 for (
size_t j = 0; j <
n; j++) {
74 A(i,j) = rand.
Uniform(-range, range);
84 template<
typename Real_t>
91 TRandom & rand = GetRandomGenerator();
95 for (
size_t i = 0; i <
m; i++) {
96 for (
size_t j = 0; j <
n; j++) {
98 if ( std::abs(value) > 2*sigma)
continue;
99 A(i,j) = rand.
Gaus(0.0, sigma);
109 template<
typename Real_t>
116 TRandom & rand = GetRandomGenerator();
120 for (
size_t i = 0; i <
m; i++) {
121 for (
size_t j = 0; j <
n; j++) {
122 A(i,j) = rand.
Uniform(-range, range);
128 template<
typename Real_t>
135 for (
size_t i = 0; i <
m; i++) {
136 for (
size_t j = 0; j <
n ; j++) {
147 template<
typename Real_t>
154 for (
size_t i = 0; i <
m; i++) {
155 for (
size_t j = 0; j <
n ; j++) {
static void SetRandomSeed(size_t seed)
Random number generator class based on M.
static void InitializeGlorotUniform(TMatrixT< AReal > &A)
Sample from a uniform distribution in range [ -lim,+lim] where lim = sqrt(6/N_in+N_out).
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...
This is the base class for the ROOT Random number generators.
static TRandom & GetRandomGenerator()
static void InitializeUniform(TMatrixT< AReal > &A)
static void InitializeGlorotNormal(TMatrixT< AReal > &A)
Truncated normal initialization (Glorot, called also Xavier normal) The values are sample with a norm...
static void InitializeZero(TMatrixT< AReal > &A)
static TRandom * fgRandomGen
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
static void InitializeIdentity(TMatrixT< AReal > &A)
Abstract ClassifierFactory template that handles arbitrary types.
static void InitializeGauss(TMatrixT< AReal > &A)