Class Scine::Utils::GradientBasedCheck¶
-
class
GradientBasedCheck
: public Scine::Utils::ConvergenceCheck¶ A convergence check based on parameter, value and gradient information.
Checks the RMS of the gradient and step, the maximum coefficient of the gradient and step and also the change in value.
For convergence the value and a set number of the other four criteria need to converge.
Public Functions
-
GradientBasedCheck
()¶ Default constructor.
-
virtual
~GradientBasedCheck
()¶ Default destructor.
-
virtual bool
checkConvergence
(const Eigen::VectorXd ¶meter, double value, const Eigen::VectorXd &gradient)¶ Checks for convergence.
- Return
true If converged.
false If not converged.
- Parameters
parameter
: The current parameters.value
: The current valuegradient
: The current gradient.
-
bool
checkMaxIterations
(unsigned int currentIteration)¶ Checks if the curret iteration is within the maximum of allowed iterations.
- Return
true If the current iteration is smaller than the maximum allowed number of iterations.
false If the current iteration is equal to or greater than the maximum allowed number of iterations.
- Parameters
currentIteration
: The number of the current iteration.
-
virtual void
addSettingsDescriptors
(UniversalSettings::DescriptorCollection &collection) const¶ See Scine::Utils::ConvergenceCheck::addSettingsDescriptors()
Public Members
-
double
stepMaxCoeff
= 1.0e-4¶ The threshold for the maximum absolute element of the last step taken.
-
double
stepRMS
= 5.0e-4¶ The threshold for the root mean square of the last step taken.
-
double
gradMaxCoeff
= 5.0e-5¶ The threshold for the maximum absolute element of the gradient.
-
double
gradRMS
= 1.0e-5¶ The threshold for the root mean square of the gradient.
-
double
deltaValue
= 1.0e-7¶ The threshold for the change in the functional value.
-
unsigned int
maxIter
= 100¶ The maximum number of iterations.
-
unsigned int
requirement
= 3¶ The number of criteria that have to converge besides the value criterion.
-