Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::SimulatedAnnealing Class Reference

Base implementation of simulated annealing fitting procedure.

Definition at line 51 of file SimulatedAnnealing.h.

Public Member Functions

 SimulatedAnnealing (IFitterTarget &target, const std::vector< TMVA::Interval * > &ranges)
 constructor
 
virtual ~SimulatedAnnealing ()
 destructor
 
virtual TClassIsA () const
 
Double_t Minimize (std::vector< Double_t > &parameters)
 minimisation algorithm
 
void SetAccuracy (Double_t eps)
 
void SetAdaptiveSpeed (Double_t speed)
 
void SetInitTemp (Double_t it)
 
void SetIPythonInteractive (bool *ExitFromTraining, UInt_t *fIPyCurrentIter_)
 
void SetMaxCalls (Int_t mc)
 
void SetMinTemp (Double_t min)
 
void SetOptions (Int_t maxCalls, Double_t initialTemperature, Double_t minTemperature, Double_t eps, TString kernelTemperatureS, Double_t temperatureScale, Double_t adaptiveSpeed, Double_t temperatureAdaptiveStep, Bool_t useDefaultScale, Bool_t useDefaultTemperature)
 option setter
 
void SetTemperatureScale (Double_t scale)
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Private Types

enum  EKernelTemperature {
  kSqrt = 0 , kIncreasingAdaptive , kDecreasingAdaptive , kLog ,
  kHomo , kSin , kGeo
}
 

Private Member Functions

void FillWithRandomValues (std::vector< Double_t > &parameters)
 random starting parameters
 
Double_t GenerateMaxTemperature (std::vector< Double_t > &parameters)
 maximum temperature
 
std::vector< Double_tGenerateNeighbour (std::vector< Double_t > &parameters, Double_t currentTemperature)
 generate adjacent parameters
 
void GenerateNeighbour (std::vector< Double_t > &parameters, std::vector< Double_t > &oldParameters, Double_t currentTemperature)
 generate adjacent parameters
 
void GenerateNewTemperature (Double_t &currentTemperature, Int_t Iter)
 generate new temperature
 
MsgLoggerLog () const
 
void ReWriteParameters (std::vector< Double_t > &from, std::vector< Double_t > &to)
 copy parameters
 
void SetDefaultScale ()
 setting of default scale
 
Bool_t ShouldGoIn (Double_t currentFit, Double_t localFit, Double_t currentTemperature)
 result checker
 

Private Attributes

Double_t fAdaptiveSpeed
 how fast temperature change in adaptive (in adaptive two variables describe the change of temperature, but fAdaptiveSpeed should be 1.0 and its not recommended to change it)
 
Double_t fEps
 epsilon
 
boolfExitFromTraining = nullptr
 
IFitterTargetfFitterTarget
 the fitter target
 
Double_t fInitialTemperature
 initial temperature
 
UInt_tfIPyCurrentIter = nullptr
 
enum TMVA::SimulatedAnnealing::EKernelTemperature fKernelTemperature
 
MsgLoggerfLogger
 message logger
 
Int_t fMaxCalls
 maximum number of minimisation calls
 
Double_t fMinTemperature
 minimum temperature
 
Double_t fProgress
 
TRandomfRandom
 random generator
 
const std::vector< TMVA::Interval * > & fRanges
 parameter ranges
 
Double_t fTemperatureAdaptiveStep
 used to calculate InitialTemperature if fUseDefaultTemperature
 
Double_t fTemperatureScale
 how fast temperature change
 
Bool_t fUseDefaultScale
 if TRUE, SA calculates its own TemperatureScale
 
Bool_t fUseDefaultTemperature
 if TRUE, SA calculates its own InitialTemperature (MinTemperautre)
 

#include <TMVA/SimulatedAnnealing.h>

Member Enumeration Documentation

◆ EKernelTemperature

Enumerator
kSqrt 
kIncreasingAdaptive 
kDecreasingAdaptive 
kLog 
kHomo 
kSin 
kGeo 

Definition at line 81 of file SimulatedAnnealing.h.

Constructor & Destructor Documentation

◆ SimulatedAnnealing()

TMVA::SimulatedAnnealing::SimulatedAnnealing ( IFitterTarget target,
const std::vector< TMVA::Interval * > &  ranges 
)

constructor

Definition at line 50 of file SimulatedAnnealing.cxx.

◆ ~SimulatedAnnealing()

TMVA::SimulatedAnnealing::~SimulatedAnnealing ( )
virtual

destructor

Definition at line 125 of file SimulatedAnnealing.cxx.

Member Function Documentation

◆ Class()

static TClass * TMVA::SimulatedAnnealing::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TMVA::SimulatedAnnealing::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TMVA::SimulatedAnnealing::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 127 of file SimulatedAnnealing.h.

◆ DeclFileName()

static const char * TMVA::SimulatedAnnealing::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 127 of file SimulatedAnnealing.h.

◆ FillWithRandomValues()

void TMVA::SimulatedAnnealing::FillWithRandomValues ( std::vector< Double_t > &  parameters)
private

random starting parameters

Definition at line 132 of file SimulatedAnnealing.cxx.

◆ GenerateMaxTemperature()

Double_t TMVA::SimulatedAnnealing::GenerateMaxTemperature ( std::vector< Double_t > &  parameters)
private

maximum temperature

Definition at line 251 of file SimulatedAnnealing.cxx.

◆ GenerateNeighbour() [1/2]

std::vector< Double_t > TMVA::SimulatedAnnealing::GenerateNeighbour ( std::vector< Double_t > &  parameters,
Double_t  currentTemperature 
)
private

generate adjacent parameters

Definition at line 169 of file SimulatedAnnealing.cxx.

◆ GenerateNeighbour() [2/2]

void TMVA::SimulatedAnnealing::GenerateNeighbour ( std::vector< Double_t > &  parameters,
std::vector< Double_t > &  oldParameters,
Double_t  currentTemperature 
)
private

generate adjacent parameters

Definition at line 150 of file SimulatedAnnealing.cxx.

◆ GenerateNewTemperature()

void TMVA::SimulatedAnnealing::GenerateNewTemperature ( Double_t currentTemperature,
Int_t  Iter 
)
private

generate new temperature

Definition at line 190 of file SimulatedAnnealing.cxx.

◆ IsA()

virtual TClass * TMVA::SimulatedAnnealing::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Definition at line 127 of file SimulatedAnnealing.h.

◆ Log()

MsgLogger & TMVA::SimulatedAnnealing::Log ( ) const
inlineprivate

Definition at line 119 of file SimulatedAnnealing.h.

◆ Minimize()

Double_t TMVA::SimulatedAnnealing::Minimize ( std::vector< Double_t > &  parameters)

minimisation algorithm

Definition at line 312 of file SimulatedAnnealing.cxx.

◆ ReWriteParameters()

void TMVA::SimulatedAnnealing::ReWriteParameters ( std::vector< Double_t > &  from,
std::vector< Double_t > &  to 
)
private

copy parameters

Definition at line 142 of file SimulatedAnnealing.cxx.

◆ SetAccuracy()

void TMVA::SimulatedAnnealing::SetAccuracy ( Double_t  eps)
inline

Definition at line 65 of file SimulatedAnnealing.h.

◆ SetAdaptiveSpeed()

void TMVA::SimulatedAnnealing::SetAdaptiveSpeed ( Double_t  speed)
inline

Definition at line 67 of file SimulatedAnnealing.h.

◆ SetDefaultScale()

void TMVA::SimulatedAnnealing::SetDefaultScale ( )
private

setting of default scale

Definition at line 230 of file SimulatedAnnealing.cxx.

◆ SetInitTemp()

void TMVA::SimulatedAnnealing::SetInitTemp ( Double_t  it)
inline

Definition at line 63 of file SimulatedAnnealing.h.

◆ SetIPythonInteractive()

void TMVA::SimulatedAnnealing::SetIPythonInteractive ( bool ExitFromTraining,
UInt_t fIPyCurrentIter_ 
)
inline

Definition at line 74 of file SimulatedAnnealing.h.

◆ SetMaxCalls()

void TMVA::SimulatedAnnealing::SetMaxCalls ( Int_t  mc)
inline

Definition at line 62 of file SimulatedAnnealing.h.

◆ SetMinTemp()

void TMVA::SimulatedAnnealing::SetMinTemp ( Double_t  min)
inline

Definition at line 64 of file SimulatedAnnealing.h.

◆ SetOptions()

void TMVA::SimulatedAnnealing::SetOptions ( Int_t  maxCalls,
Double_t  initialTemperature,
Double_t  minTemperature,
Double_t  eps,
TString  kernelTemperatureS,
Double_t  temperatureScale,
Double_t  adaptiveSpeed,
Double_t  temperatureAdaptiveStep,
Bool_t  useDefaultScale,
Bool_t  useDefaultTemperature 
)

option setter

Definition at line 73 of file SimulatedAnnealing.cxx.

◆ SetTemperatureScale()

void TMVA::SimulatedAnnealing::SetTemperatureScale ( Double_t  scale)
inline

Definition at line 66 of file SimulatedAnnealing.h.

◆ ShouldGoIn()

Bool_t TMVA::SimulatedAnnealing::ShouldGoIn ( Double_t  currentFit,
Double_t  localFit,
Double_t  currentTemperature 
)
private

result checker

Definition at line 219 of file SimulatedAnnealing.cxx.

◆ Streamer()

virtual void TMVA::SimulatedAnnealing::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void TMVA::SimulatedAnnealing::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 127 of file SimulatedAnnealing.h.

Member Data Documentation

◆ fAdaptiveSpeed

Double_t TMVA::SimulatedAnnealing::fAdaptiveSpeed
private

how fast temperature change in adaptive (in adaptive two variables describe the change of temperature, but fAdaptiveSpeed should be 1.0 and its not recommended to change it)

Definition at line 110 of file SimulatedAnnealing.h.

◆ fEps

Double_t TMVA::SimulatedAnnealing::fEps
private

epsilon

Definition at line 108 of file SimulatedAnnealing.h.

◆ fExitFromTraining

bool* TMVA::SimulatedAnnealing::fExitFromTraining = nullptr
private

Definition at line 125 of file SimulatedAnnealing.h.

◆ fFitterTarget

IFitterTarget& TMVA::SimulatedAnnealing::fFitterTarget
private

the fitter target

Definition at line 100 of file SimulatedAnnealing.h.

◆ fInitialTemperature

Double_t TMVA::SimulatedAnnealing::fInitialTemperature
private

initial temperature

Definition at line 106 of file SimulatedAnnealing.h.

◆ fIPyCurrentIter

UInt_t* TMVA::SimulatedAnnealing::fIPyCurrentIter = nullptr
private

Definition at line 124 of file SimulatedAnnealing.h.

◆ fKernelTemperature

enum TMVA::SimulatedAnnealing::EKernelTemperature TMVA::SimulatedAnnealing::fKernelTemperature
private

◆ fLogger

MsgLogger* TMVA::SimulatedAnnealing::fLogger
mutableprivate

message logger

Definition at line 118 of file SimulatedAnnealing.h.

◆ fMaxCalls

Int_t TMVA::SimulatedAnnealing::fMaxCalls
private

maximum number of minimisation calls

Definition at line 105 of file SimulatedAnnealing.h.

◆ fMinTemperature

Double_t TMVA::SimulatedAnnealing::fMinTemperature
private

minimum temperature

Definition at line 107 of file SimulatedAnnealing.h.

◆ fProgress

Double_t TMVA::SimulatedAnnealing::fProgress
private

Definition at line 121 of file SimulatedAnnealing.h.

◆ fRandom

TRandom* TMVA::SimulatedAnnealing::fRandom
private

random generator

Definition at line 101 of file SimulatedAnnealing.h.

◆ fRanges

const std::vector<TMVA::Interval*>& TMVA::SimulatedAnnealing::fRanges
private

parameter ranges

Definition at line 102 of file SimulatedAnnealing.h.

◆ fTemperatureAdaptiveStep

Double_t TMVA::SimulatedAnnealing::fTemperatureAdaptiveStep
private

used to calculate InitialTemperature if fUseDefaultTemperature

Definition at line 113 of file SimulatedAnnealing.h.

◆ fTemperatureScale

Double_t TMVA::SimulatedAnnealing::fTemperatureScale
private

how fast temperature change

Definition at line 109 of file SimulatedAnnealing.h.

◆ fUseDefaultScale

Bool_t TMVA::SimulatedAnnealing::fUseDefaultScale
private

if TRUE, SA calculates its own TemperatureScale

Definition at line 115 of file SimulatedAnnealing.h.

◆ fUseDefaultTemperature

Bool_t TMVA::SimulatedAnnealing::fUseDefaultTemperature
private

if TRUE, SA calculates its own InitialTemperature (MinTemperautre)

Definition at line 116 of file SimulatedAnnealing.h.

Libraries for TMVA::SimulatedAnnealing:

The documentation for this class was generated from the following files: