Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
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 * (see tmva/doc/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 "RtypesCore.h"
43
44namespace TMVA {
45
47
48 public:
49
52
53 // setters
54 void SetConvergenceParameters( Int_t steps, Double_t improvement )
55 { fSteps = steps; fImprovement = improvement; }
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
bool Bool_t
Definition RtypesCore.h:63
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Check for convergence.
void SetConvergenceParameters(Int_t steps, Double_t improvement)
Int_t fMaxCounter
! maximum value for the counter so far
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...
void SetCurrentValue(Float_t value)
Float_t Progress()
returns a float from 0 (just started) to 1 (finished)
std::deque< Short_t > fSuccessList
to calculate the improvement-speed
Float_t fCurrentValue
! current value
Int_t fCounter
! counts the number of steps without improvement
Float_t SpeedControl(UInt_t ofSteps)
this function provides the ability to change the learning rate according to the success of the last g...
Float_t fImprovement
! minimum improvement which counts as improvement
Float_t fConvValue
! the best "fitness" value
Int_t fSteps
! number of steps without improvement required for convergence
create variable transformations