14 #ifndef __TRAININGRATEALGORITHM_H__
15 #define __TRAININGRATEALGORITHM_H__
29 #include "neural_network.h"
30 #include "performance_functional.h"
34 #include "../tinyxml2/tinyxml2.h"
97 if(
A == other_triplet.
A
98 &&
U == other_triplet.
U
99 &&
B == other_triplet.
B)
128 std::ostringstream buffer;
130 buffer <<
"A = (" <<
A[0] <<
"," <<
A[1] <<
")\n"
131 <<
"U = (" <<
U[0] <<
"," <<
U[1] <<
")\n"
132 <<
"B = (" <<
B[0] <<
"," <<
B[1] <<
")" << std::endl;
134 return(buffer.str());
150 std::ostringstream buffer;
152 if(
A[0] >
U[0] ||
U[0] >
B[0])
154 buffer <<
"OpenNN Exception: TrainingRateAlgorithm class.\n"
155 <<
"void check(void) const method.\n"
156 <<
"Uncorrect triplet:\n"
159 throw std::logic_error(buffer.str());
162 if(
A[1] <
U[1] ||
U[1] >
B[1])
164 buffer <<
"OpenNN Exception: TrainingRateAlgorithm class.\n"
165 <<
"void check(void) const method.\n"
166 <<
"Triplet does not satisfy minimum condition:\n"
169 throw std::logic_error(buffer.str());
255 tinyxml2::XMLDocument*
to_XML(
void)
const;
256 void from_XML(
const tinyxml2::XMLDocument&);
TrainingRateMethod training_rate_method
Variable containing the actual method used to obtain a suitable perform_training rate.
double calculate_Brent_method_training_rate(const Triplet &) const
PerformanceFunctional * get_performance_functional_pointer(void) const
Vector< double > A
Left point of the triplet.
void print(void) const
Prints the triplet points to the standard output.
const double & get_error_training_rate(void) const
virtual ~Triplet(void)
Destructor.
void set_performance_functional_pointer(PerformanceFunctional *)
void set(void)
Sets the size of a vector to zero.
bool display
Display messages to screen.
std::string write_training_rate_method(void) const
Returns a string with the name of the training rate method to be used.
tinyxml2::XMLDocument * to_XML(void) const
Vector< double > U
Interior point of the triplet.
Vector< double > calculate_fixed_directional_point(const double &, const Vector< double > &, const double &) const
Vector< double > calculate_Brent_method_directional_point(const double &, const Vector< double > &, const double &) const
bool operator==(const Triplet &other_triplet) const
bool has_performance_functional(void) const
Triplet(void)
Default constructor.
Vector< double > calculate_directional_point(const double &, const Vector< double > &, const double &) const
double calculate_golden_section_training_rate(const Triplet &) const
TrainingRateMethod
Available training operators for obtaining the perform_training rate.
bool has_length_zero(void) const
void set_warning_training_rate(const double &)
void set_training_rate_tolerance(const double &)
double bracketing_factor
Increase factor when bracketing a minimum.
virtual ~TrainingRateAlgorithm(void)
Destructor.
virtual void set_default(void)
Sets the members of the training rate algorithm to their default values.
TrainingRateAlgorithm(void)
void from_XML(const tinyxml2::XMLDocument &)
const double & get_warning_training_rate(void) const
double warning_training_rate
Big training rate value at which the algorithm displays a warning.
void set_error_training_rate(const double &)
const bool & get_display(void) const
Triplet calculate_bracketing_triplet(const double &, const Vector< double > &, const double &) const
const double & get_training_rate_tolerance(void) const
Returns the tolerance value in line minimization.
const double & get_bracketing_factor(void) const
Returns the increase factor when bracketing a minimum in line minimization.
double training_rate_tolerance
Maximum interval length for the training rate.
Vector< double > calculate_golden_section_directional_point(const double &, const Vector< double > &, const double &) const
Vector< double > B
Right point of the triplet.
void set_bracketing_factor(const double &)
PerformanceFunctional * performance_functional_pointer
Pointer to an external performance functional object.
void set_display(const bool &)
std::string to_string(void) const
Writes a string with the values of A, U and B.
double error_training_rate
Big training rate value at which the algorithm throws an exception.
const TrainingRateMethod & get_training_rate_method(void) const
Returns the training rate method used for training.
void set_training_rate_method(const TrainingRateMethod &)