Logo ROOT   6.07/09
Reference Guide
TestDerivativesCuda.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  using Scalar_t = Double_t;
26  Double_t error;
27 
28  //
29  // Activation Functions
30  //
31 
32  std::cout << "Activation Functions:" << std::endl;
33  error = testActivationFunctionDerivatives<TCuda<Scalar_t>>();
34  std::cout << "Total : ";
35  std::cout << "Maximum Relative Error = " << error;
36  std::cout << std::endl << std::endl;
37  if (error > 1e-2)
38  return 1;
39 
40  //
41  // Loss Functions
42  //
43 
44  std::cout << "Loss Functions:" << std::endl;
45  error = testLossFunctionGradients<TCuda<Scalar_t>>();
46  std::cout << "Total : ";
47  std::cout << "Maximum Relative Error = " << error;
48  std::cout << std::endl << std::endl;
49  if (error > 1e-3)
50  return 1;
51 
52  //
53  // Regularization Functions
54  //
55 
56  std::cout << "Regularization:" << std::endl;
57  error = testRegularizationGradients<TCuda<Scalar_t>>();
58  std::cout << "Total : ";
59  std::cout << "Maximum Relative Error = " << error;
60  std::cout << std::endl << std::endl;
61  if (error > 1e-3)
62  return 1;
63 
64  return 0;
65 }
Definition: Blas.h:58
int main()
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