27template <
typename AFloat>
30template<
typename AFloat>
33 if (!fgRandomGen) fgRandomGen =
new TRandom3();
34 fgRandomGen->SetSeed(seed);
36template<
typename AFloat>
39 if (!fgRandomGen) fgRandomGen =
new TRandom3(0);
43template<
typename AFloat>
50 TRandom & rand = GetRandomGenerator();
55 for (
size_t i = 0; i <
m; i++) {
56 for (
size_t j = 0; j <
n; j++) {
64template<
typename AFloat>
71 TRandom & rand = GetRandomGenerator();
76 for (
size_t i = 0; i <
m; i++) {
77 for (
size_t j = 0; j <
n; j++) {
78 B(i,j) = rand.
Uniform(-range, range);
89template<
typename AFloat>
96 TRandom & rand = GetRandomGenerator();
101 for (
size_t i = 0; i <
m; i++) {
102 for (
size_t j = 0; j <
n; j++) {
118template<
typename AFloat>
125 TRandom & rand = GetRandomGenerator();
130 for (
size_t i = 0; i <
m; i++) {
131 for (
size_t j = 0; j <
n; j++) {
132 B(i,j) = rand.
Uniform(-range, range);
135 printf(
"initialize glorotuniform \n");
141template<
typename AFloat>
149 for (
size_t i = 0; i <
m; i++) {
150 for (
size_t j = 0; j <
n ; j++) {
162template<
typename AFloat>
169template <
typename AFloat>
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static void SetRandomSeed(size_t seed)
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...
static void InitializeUniform(Matrix_t &A)
static void InitializeGauss(Matrix_t &A)
static TRandom * fgRandomGen
static void InitializeIdentity(Matrix_t &A)
static TRandom & GetRandomGenerator()
static void InitializeZero(Matrix_t &A)
void Print(Option_t *name="") const override
Print the matrix as a table of elements.
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