Logo ROOT   6.10/09
Reference Guide
TestLossFunctions.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 // Test for the loss function reference implementation using the //
14 // generic test defined in TestLossFunctions.h. //
15 ///////////////////////////////////////////////////////////////////
16 
17 #include <iostream>
19 #include "TestLossFunctions.h"
20 
21 using namespace TMVA::DNN;
22 
23 int main()
24 {
25  std::cout << "Testing Loss Functions:" << std::endl << std::endl;
26 
27  double error;
28 
29  //
30  // Mean Squared Error.
31  //
32 
33  error = testMeanSquaredError<TReference<double>>(10);
34  std::cout << "Testing mean squared error loss: ";
35  std::cout << "maximum relative error = " << error << std::endl;
36  if (error > 1e-10)
37  return 1;
38 
39  error = testMeanSquaredErrorGradients<TReference<double>>(10);
40  std::cout << "Testing mean squared error gradient: ";
41  std::cout << "maximum relative error = " << error << std::endl;
42  if (error > 1e-10)
43  return 1;
44 
45  //
46  // Cross Entropy.
47  //
48 
49  error = testCrossEntropy<TReference<double>>(10);
50  std::cout << "Testing cross entropy loss: ";
51  std::cout << "maximum relative error = " << error << std::endl;
52  if (error > 1e-10)
53  return 1;
54 
55  error = testCrossEntropyGradients<TReference<double>>(10);
56  std::cout << "Testing cross entropy gradient: ";
57  std::cout << "maximum relative error = " << error << std::endl;
58  if (error > 1e-10)
59  return 1;
60 }
int main()
Definition: Blas.h:58
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630