|
Continuum Membrane 719025a62b1e384a6ff80e2f2a223ef4012153dc
|
A class that defines an optimization algorithm and its settings. This class defines the settings for an optimization algorithm, including whether to use nonlinear conjugate gradient (NCG), whether NCG has gotten stuck and cannot further minimize, and whether to use R-pi adaptive method for regularization energy. These settings can be accessed and modified using the public member variables of the class. More...
#include <Model.hpp>
Public Member Functions | |
| OptimizationAlgorithm () | |
| Constructor for the OptimizationAlgorithm class. | |
| OptimizationAlgorithm (const int trialIterationInterval, const double c1, const double c2, const double stepThreshold) | |
| Constructor for the OptimizationAlgorithm class. | |
| void | reset_NCG_Rpi () |
| Reset NCG and Rpi to default. | |
| bool | disable_NCG_if_stuck_consecutively () |
| Disables the use of NCG if it has been stuck consecutively over a threshold. | |
Public Attributes | |
| bool | usingNCG = false |
| Flag indicating whether to use the nonlinear conjugate gradient optimizer. | |
| bool | isNCGstuck = false |
| Flag indicating whether the NCG optimizer has gotten stuck and cannot further minimize. | |
| bool | usingRpi = false |
| Flag indicating whether to use the R-pi adaptive method for regularization energy. | |
| bool | isCriteriaSatisfied = false |
| Flag indicating whether the optimization criteria have been met. | |
| double | trialStepSize = 0.0 |
| The step size used in the optimization algorithm. | |
| int | trialIterationInterval = 300 |
| The number of iterations between trial step size adjustments. | |
| double | c1 = 1e-6 |
| The c1 parameter in the NCG Wolfe condition. | |
| double | c2 = 0.001 |
| The c2 parameter in the NCG Wolfe condition. | |
| double | stepThreshold = 1e-15 |
| The lower bound for the step size in NCG. | |
| int | nConsecutiveNcgStuck = 0 |
| The number of consecutive times the NCG optimizer has gotten stuck. | |
| int | nConsecutiveNcgStuckThreshold = 3 |
| The threshold of consecutive NCG stuck iterations before disabling it. | |
| double | energyDiffThreshold = 1e-5 |
| The energy difference threshold for convergence checking. | |
| double | forceDiffThreshold = 1e-4 |
| The mean force difference threshold for convergence checking. | |
A class that defines an optimization algorithm and its settings. This class defines the settings for an optimization algorithm, including whether to use nonlinear conjugate gradient (NCG), whether NCG has gotten stuck and cannot further minimize, and whether to use R-pi adaptive method for regularization energy. These settings can be accessed and modified using the public member variables of the class.
| OptimizationAlgorithm::OptimizationAlgorithm | ( | ) |
Constructor for the OptimizationAlgorithm class.
Initializes an instance of the OptimizationAlgorithm class with default settings. Sets usingNCG to true, isNCGstuck to false, and usingRpi to true.
| OptimizationAlgorithm::OptimizationAlgorithm | ( | const int | trialIterationInterval, |
| const double | c1, | ||
| const double | c2, | ||
| const double | stepThreshold | ||
| ) |
Constructor for the OptimizationAlgorithm class.
Initializes an instance of the OptimizationAlgorithm class with default settings. Customize iteration interval, c1, c2, and step threshold. Sets usingNCG to true, isNCGstuck to false, and usingRpi to true.
| bool OptimizationAlgorithm::disable_NCG_if_stuck_consecutively | ( | ) |
Disables the use of NCG if it has been stuck consecutively over a threshold.
If the NCG optimizer has been stuck for too many consecutive iterations (as determined by the isNCGstuck flag), this function will increment a counter nConsecutiveNcgStuck. If that counter exceeds a threshold of nConsecutiveNcgStuckThreshold, the usingNCG flag will be set to false, indicating that NCG should not be used. Otherwise, usingNCG remains true.
If the NCG optimizer is not currently stuck, the nConsecutiveNcgStuck counter is reset to 0 and usingNCG is set to true.
| void OptimizationAlgorithm::reset_NCG_Rpi | ( | ) |
Reset NCG and Rpi to default.
Sets usingNCG to true, isNCGstuck to false, and usingRpi to true.
| double OptimizationAlgorithm::c1 = 1e-6 |
The c1 parameter in the NCG Wolfe condition.
| double OptimizationAlgorithm::c2 = 0.001 |
The c2 parameter in the NCG Wolfe condition.
| double OptimizationAlgorithm::energyDiffThreshold = 1e-5 |
The energy difference threshold for convergence checking.
| double OptimizationAlgorithm::forceDiffThreshold = 1e-4 |
The mean force difference threshold for convergence checking.
| bool OptimizationAlgorithm::isCriteriaSatisfied = false |
Flag indicating whether the optimization criteria have been met.
| bool OptimizationAlgorithm::isNCGstuck = false |
Flag indicating whether the NCG optimizer has gotten stuck and cannot further minimize.
| int OptimizationAlgorithm::nConsecutiveNcgStuck = 0 |
The number of consecutive times the NCG optimizer has gotten stuck.
| int OptimizationAlgorithm::nConsecutiveNcgStuckThreshold = 3 |
The threshold of consecutive NCG stuck iterations before disabling it.
| double OptimizationAlgorithm::stepThreshold = 1e-15 |
The lower bound for the step size in NCG.
| int OptimizationAlgorithm::trialIterationInterval = 300 |
The number of iterations between trial step size adjustments.
| double OptimizationAlgorithm::trialStepSize = 0.0 |
The step size used in the optimization algorithm.
| bool OptimizationAlgorithm::usingNCG = false |
Flag indicating whether to use the nonlinear conjugate gradient optimizer.
| bool OptimizationAlgorithm::usingRpi = false |
Flag indicating whether to use the R-pi adaptive method for regularization energy.