24template <
typename AReal>
28 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
29 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
36template <
typename AReal>
39 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
40 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
47template <
typename AReal>
50 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
51 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
58template <
typename AReal>
61 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
62 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
69template <
typename AReal>
72 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
73 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
74 A(i, j) = 1.0 /
A(i, j);
80template <
typename AReal>
83 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
84 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
91template <
typename AReal>
94 for (
Int_t i = 0; i <
A.GetNrows(); i++) {
95 for (
Int_t j = 0; j <
A.GetNcols(); j++) {
102template<
typename AReal>
107 AReal *
a =
A.GetMatrixArray();
110 for (
int index = 0; index <
A.GetNoElements() ; ++index) {
111 a[index] =
a[index] - alpha *
m[index]/(
sqrt(
v[index]) + eps);
116template<
typename AReal>
121 AReal *
a =
A.GetMatrixArray();
122 const AReal *
b =
B.GetMatrixArray();
123 for (
int index = 0; index <
A.GetNoElements() ; ++index) {
128template<
typename AReal>
133 AReal *
a =
A.GetMatrixArray();
134 const AReal *
b =
B.GetMatrixArray();
135 for (
int index = 0; index <
A.GetNoElements() ; ++index) {
136 a[index] =
beta *
a[index] + (1.-
beta) *
b[index] *
b[index];
static void AdamUpdate(TMatrixT< AReal > &A, const TMatrixT< AReal > &M, const TMatrixT< AReal > &V, AReal alpha, AReal eps)
Update functions for ADAM optimizer.
static void AdamUpdateSecondMom(TMatrixT< AReal > &A, const TMatrixT< AReal > &B, AReal beta)
static void AdamUpdateFirstMom(TMatrixT< AReal > &A, const TMatrixT< AReal > &B, AReal beta)
static void ConstAdd(TMatrixT< AReal > &A, AReal beta)
Add the constant beta to all the elements of matrix A and write the result into A.
static void ReciprocalElementWise(TMatrixT< AReal > &A)
Reciprocal each element of the matrix A and write the result into A.
static void SquareElementWise(TMatrixT< AReal > &A)
Square each element of the matrix A and write the result into A.
static void Hadamard(TMatrixT< AReal > &A, const TMatrixT< AReal > &B)
In-place Hadamard (element-wise) product of matrices A and B with the result being written into A.
static void SqrtElementWise(TMatrixT< AReal > &A)
Square root each element of the matrix A and write the result into A.
static void SumColumns(TMatrixT< AReal > &B, const TMatrixT< AReal > &A)
Sum columns of (m x n) matrixx A and write the results into the first m elements in A.
static void ConstMult(TMatrixT< AReal > &A, AReal beta)
Multiply the constant beta to all the elements of matrix A and write the result into A.
virtual const Element * GetMatrixArray() const
double beta(double x, double y)
Calculates the beta function.
create variable transformations