 |
Belle II Software
release-05-01-25
|
12 #ifndef INCLUDE_GUARD_BELLE2_MVA_FANN_HEADER
13 #define INCLUDE_GUARD_BELLE2_MVA_FANN_HEADER
15 #include <mva/interface/Options.h>
16 #include <mva/interface/Teacher.h>
17 #include <mva/interface/Expert.h>
38 virtual void load(
const boost::property_tree::ptree& pt)
override;
44 virtual void save(boost::property_tree::ptree& pt)
const override;
54 virtual std::string
getMethod()
const override {
return "FANN"; }
130 virtual std::vector<float>
apply(
Dataset& test_data)
const override;
unsigned int m_random_seeds
Number of times the training is repeated with a new weight random seed.
FANNTeacher(const GeneralOptions &general_options, const FANNOptions &specific_options)
Constructs a new teacher using the GeneralOptions and specific options of this training.
Options for the FANN MVA method.
Abstract base class of all Datasets given to the MVA interface The current event can always be access...
virtual ~FANNExpert()
Destructor of FANN Expert.
The Weightfile class serializes all information about a training into an xml tree.
std::string m_training_method
Training method for back propagation.
virtual void load(Weightfile &weightfile) override
Load the expert from a Weightfile.
virtual void save(boost::property_tree::ptree &pt) const override
Save mechanism to store Options in a xml tree.
std::string m_hidden_activiation_function
Activation function in hidden layer.
virtual std::string getMethod() const override
Return method name.
double m_validation_fraction
Fraction of training sample used for validation in order to avoid overtraining.
Specific Options, all mehtod Options have to inherit from this class.
virtual void load(const boost::property_tree::ptree &pt) override
Load mechanism to load Options from a xml tree.
unsigned int m_test_rate
Error on validation is compared with the one before.
bool m_verbose_mode
Sets to report training status or not.
Abstract base class for different kinds of events.
unsigned int m_number_of_threads
Number of threads for parallel training.
Abstract base class of all Teachers Each MVA library has its own implementation of this class,...
Teacher for the FANN MVA method.
Abstract base class of all Expert Each MVA library has its own implementation of this class,...
General options which are shared by all MVA trainings.
Expert for the FANN MVA method.
std::string m_output_activiation_function
Activation function in output layer.
std::string m_hidden_layers_architecture
String containing the architecture of hidden neurons.
bool m_scale_features
Scale features before training.
bool m_scale_target
Scale target before training.
virtual std::vector< float > apply(Dataset &test_data) const override
Apply this expert onto a dataset.
unsigned int m_max_epochs
Maximum number of epochs.
virtual Weightfile train(Dataset &training_data) const override
Train a mva method using the given dataset returning a Weightfile.
std::string m_error_function
Loss function.
FANNOptions m_specific_options
Method specific options.
struct fann * m_ann
Pointer to FANN expert.
virtual po::options_description getDescription() override
Returns a program options description for all available options.
FANNOptions m_specific_options
Method specific options.
std::vector< unsigned int > getHiddenLayerNeurons(unsigned int nf) const
Returns the internal vector parameter with the number of hidden neurons per layer.