Logo ROOT   6.10/09
Reference Guide
ConvergenceTest.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : ConvergenceTest *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Contains all the data information *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland *
16  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
18  * *
19  * Copyright (c) 2006: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
22  * MPI-K Heidelberg, Germany *
23  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_ConvergenceTest
30 #define ROOT_TMVA_ConvergenceTest
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // ConvergenceTest //
35 // //
36 // check for convergence //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 
40 #include <deque>
41 
42 #include "Rtypes.h"
43 
44 namespace TMVA {
45 
47 
48  public:
49 
52 
53  // setters
54  void SetConvergenceParameters( Int_t steps, Double_t improvement )
55  { fSteps = steps; fImprovement = improvement; }
56  void SetCurrentValue( Float_t value ) { fCurrentValue = value; }
59 
60  // getters
61  Bool_t HasConverged( Bool_t withinConvergenceBand = kFALSE );
62  Float_t Progress(); // from 0 (just started) to 1 (finished)
63  Float_t SpeedControl( UInt_t ofSteps );
64 
65 
66  protected:
67 
68  Float_t fCurrentValue; //! current value
69 
70  Float_t fImprovement; //! minimum improvement which counts as improvement
71  Int_t fSteps; //! number of steps without improvement required for convergence
72 
73  private:
74 
75  Int_t fCounter; //! counts the number of steps without improvement
76  Float_t fConvValue; //! the best "fitness" value
77  Int_t fMaxCounter; //! maximum value for the counter so far
78 
79  // speed-control (gives back the learning speed = improvement-rate in the last N steps)
80  // successList keeps track of the improvements to be able
83  std::deque<Short_t> fSuccessList; // to calculate the improvement-speed
84 
85  };
86 }
87 
88 #endif
Int_t fMaxCounter
the best "fitness" value
Float_t fBestResult
maximum value for the counter so far
float Float_t
Definition: RtypesCore.h:53
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Float_t fImprovement
current value
void SetConvergenceParameters(Int_t steps, Double_t improvement)
Bool_t HasConverged(Bool_t withinConvergenceBand=kFALSE)
gives back true if the last "steps" steps have lead to an improvement of the "fitness" of the "indivi...
Int_t fSteps
minimum improvement which counts as improvement
Float_t Progress()
returns a float from 0 (just started) to 1 (finished)
unsigned int UInt_t
Definition: RtypesCore.h:42
ConvergenceTest()
constructor
const Bool_t kFALSE
Definition: RtypesCore.h:92
double Double_t
Definition: RtypesCore.h:55
~ConvergenceTest()
destructor
std::deque< Short_t > fSuccessList
Abstract ClassifierFactory template that handles arbitrary types.
Float_t SpeedControl(UInt_t ofSteps)
this function provides the ability to change the learning rate according to the success of the last g...
Check for convergence.
Int_t fCounter
number of steps without improvement required for convergence
void SetCurrentValue(Float_t value)
Float_t fConvValue
counts the number of steps without improvement