Logo ROOT   6.08/07
Reference Guide
TestMinimizationCuda.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 // Use the generic tests defined in TestMinimization.h to test the //
14 // training of Neural Networks for CUDA architectures. //
15 /////////////////////////////////////////////////////////////////////
16 
17 #include <iostream>
20 #include "TMVA/DNN/Minimizers.h"
21 #include "TestMinimization.h"
22 
23 using namespace TMVA::DNN;
24 
25 int main()
26 {
27  std::cout << "Testing minimization: (single precision)" << std::endl;
28 
29  Double_t error = testMinimization<TCuda<Real_t>>();
30  std::cout << "Gradient Descent: Maximum relative error = " << error << std::endl;
31  if (error > 1) {
32  return 1;
33  }
34 
35  error = testMinimizationMomentum<TCuda<Real_t>>();
36  std::cout << "Momentum: Maximum relative error = " << error << std::endl;
37  if (error > 1) {
38  return 1;
39  }
40  std::cout << std::endl << "Testing minimization: (double precision)" << std::endl;
41 
42  error = testMinimization<TCuda<Double_t>>();
43  std::cout << "Gradient Descent: Maximum relative error = " << error << std::endl;
44  if (error > 1e-3) {
45  return 1;
46  }
47 
48  error = testMinimizationMomentum<TCuda<Double_t>>();
49  std::cout << "Momentum: Maximum relative error = " << error << std::endl;
50  if (error > 1e-3) {
51  return 1;
52  }
53 }
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