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>
45 size_t n = A.GetNcols();
49 AFloat
sigma = sqrt(2.0 / ((AFloat)
n));
51 for (
size_t i = 0; i < A.GetSize(); ++i) {
52 A.GetRawDataPointer()[i] =
rand.Gaus(0.0,
sigma);
60template<
typename AFloat>
64 size_t n = A.GetNcols();
68 AFloat
range = sqrt(2.0 / ((AFloat)
n));
74 for (
size_t i = 0; i < A.GetSize(); ++i) {
84template<
typename AFloat>
95 AFloat
sigma = sqrt(6.0 /( ((AFloat)
n) + ((AFloat)
m)) );
98 size_t nsize = A.GetSize();
99 for (
size_t i = 0; i <
nsize; i++) {
104 A.GetRawDataPointer()[i] =
value;
113template<
typename AFloat>
123 AFloat
range = sqrt(6.0 /( ((AFloat)
n) + ((AFloat)
m)) );
125 size_t nsize = A.GetSize();
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>
169 size_t n = A.GetSize();
171 for (
size_t i = 0; i <
n; i++) {
172 A.GetRawDataPointer()[i] = 0.0;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static TRandom * fgRandomGen
TCpuTensor< AReal > Tensor_t
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.
create variable transformations