Inertia weight functor, which decreases linearly over time.
More...
#include <ParticleSwarm.hh>
template<typename Scalar>
class Optimist::Optimizer::LinearDecrease< Scalar >
- Template Parameters
-
| Scalar | Floating-point number type. The inertia weight is calculated by the following formula:
\[ w = w_{\min} + (w_{\max} - w_{\min}) * \displaystyle\frac{t}{t_{\max}}
\text{.}
\]
|
◆ LinearDecrease() [1/2]
template<typename Scalar>
Class class onstructor with default minimum and maximum weights equal to 0.4 and 0.9, respectively.
◆ LinearDecrease() [2/2]
template<typename Scalar>
Class constructor that accepts the minimum and maximum weight of the linear decrease.
- Parameters
-
| [in] | min_weight | Lower bound of the inertia weight. |
| [in] | max_weight | Upper bound of the inertia weight. |
◆ operator()()
template<typename Scalar>
Get the inertia weight.
- Parameters
-
| [in] | iteration | Current iteration. |
| [in] | max_iterations | Maximum number of iterations. |
- Returns
- The inertia weight.
◆ m_max_weight
template<typename Scalar>
◆ m_min_weight
template<typename Scalar>
The documentation for this class was generated from the following file: