29 template <
typename Architecture_t>
31 ->
typename Architecture_t::Scalar_t
33 using Scalar_t =
typename Architecture_t::Scalar_t;
34 using Matrix_t =
typename Architecture_t::Matrix_t;
37 size_t nSamples = 10000;
40 for (
size_t i = 0; i < 10000; i++) {
44 DataLoader_t loader(input, nSamples, 5, 1, 1);
46 Matrix_t XArch(X),
Sum(1,1), SumTotal(1,1);
47 Scalar_t
sum = 0.0, sumTotal = 0.0;
49 for (
auto b : loader) {
50 Architecture_t::SumColumns(
Sum,
b.GetInput());
54 Architecture_t::SumColumns(SumTotal, XArch);
55 sumTotal = SumTotal(0,0);
57 return fabs(sumTotal - sum) / sumTotal;
64 template <
typename Architecture_t>
66 ->
typename Architecture_t::Scalar_t
68 using Scalar_t =
typename Architecture_t::Scalar_t;
74 DataLoader_t loader(input, 2000, 20, 100, 100);
81 Scalar_t maximumError = 0.0;
82 for (
auto b : loader) {
83 auto inputMatrix =
b.GetInput();
84 auto outputMatrix =
b.GetOutput();
85 Scalar_t error = net.Loss(inputMatrix, outputMatrix);
86 maximumError = std::max(error, maximumError);
static long int sum(long int i)
void randomMatrix(AMatrix &X)
Fill matrix with random, Gaussian-distributed values.
auto testSum() -> typename Architecture_t::Scalar_t
Test that the data loader loads all data in the data set by summing up all elements batch wise and co...
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
Double_t Sum(const double *x, const double *p)
Abstract ClassifierFactory template that handles arbitrary types.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
auto testIdentity() -> typename Architecture_t::Scalar_t
Test the data loader by loading identical input and output data, running it through an identity neura...
std::pair< const TMatrixT< Double_t > &, const TMatrixT< Double_t > & > MatrixInput_t