Logo ROOT   6.08/07
Reference Guide
TestDerivatives.cxx
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Simon Pfreundschuh
3 
4 /*************************************************************************
5  * Copyright (C) 2016, Simon Pfreundschuh *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 ///////////////////////////////////////////////////////////////////
13 // Concrete instantiation of the generic derivative test for the //
14 // reference implementation. //
15 ///////////////////////////////////////////////////////////////////
16 
17 #include <iostream>
19 #include "TestDerivatives.h"
20 
21 using namespace TMVA::DNN;
22 
23 int main()
24 {
25 
26  double error;
27 
28  //
29  // Activation Functions
30  //
31 
32  std::cout << "Activation Functions:" << std::endl;
33  error = testActivationFunctionDerivatives<TReference<double>>();
34  std::cout << "Total : ";
35  std::cout << "Maximum Relative Error = " << print_error(error);
36  std::cout << std::endl << std::endl;
37  if (error > 1e-5)
38  return 1;
39 
40  //
41  // Loss Functions
42  //
43 
44  std::cout << "Loss Functions:" << std::endl;
45  error = testLossFunctionGradients<TReference<double>>();
46  std::cout << "Total : ";
47  std::cout << "Maximum Relative Error = " << print_error(error);
48  std::cout << std::endl << std::endl;
49  if (error > 1e-5)
50  return 1;
51 
52  //
53  // Regularization Functions
54  //
55 
56  std::cout << "Regularization:" << std::endl;
57  error = testRegularizationGradients<TReference<double>>();
58  std::cout << "Total : ";
59  std::cout << "Maximum Relative Error = " << print_error(error);
60  std::cout << std::endl << std::endl;
61  if (error > 1e-5)
62  return 1;
63 
64  return 0;
65 }
Definition: Blas.h:58
std::string print_error(AFloat &e)
Color code error.
Definition: Utility.h:232
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
int main()