Loading [MathJax]/extensions/tex2jax.js
Logo ROOT   6.08/07
Reference Guide
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TestDerivativesCpu.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 // multi-threaded CPU implementation. //
15 ///////////////////////////////////////////////////////////////////
16 
17 #include <iostream>
19 #include "TestDerivatives.h"
20 
21 using namespace TMVA::DNN;
22 
23 int main()
24 {
25  using Scalar_t = Double_t;
26 
27  double error;
28 
29  //
30  // Activation Functions
31  //
32 
33  std::cout << "Activation Functions:" << std::endl;
34  error = testActivationFunctionDerivatives<TCpu<Scalar_t>>();
35  std::cout << "Total : ";
36  std::cout << "Maximum Relative Error = " << error;
37  std::cout << std::endl << std::endl;
38  if (error > 1e-3)
39  return 1;
40 
41  //
42  // Loss Functions
43  //
44 
45  std::cout << "Loss Functions:" << std::endl;
46  error = testLossFunctionGradients<TCpu<Scalar_t>>();
47  std::cout << "Total : ";
48  std::cout << "Maximum Relative Error = " << error;
49  std::cout << std::endl << std::endl;
50  if (error > 1e-3)
51  return 1;
52 
53  //
54  // Regularization Functions
55  //
56 
57  std::cout << "Regularization:" << std::endl;
58  error = testRegularizationGradients<TCpu<Scalar_t>>();
59  std::cout << "Total : ";
60  std::cout << "Maximum Relative Error = " << error;
61  std::cout << std::endl << std::endl;
62  if (error > 1e-3)
63  return 1;
64 
65  return 0;
66 }
int main()
Definition: Blas.h:58
double Double_t
Definition: RtypesCore.h:55
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630