|
|
typedef std::function< T(const ublas::vector< T > &x)> | function_type |
| |
|
typedef std::function< T(const ublas::vector< T > &x)> | function_type |
| |
|
| | BroydenFletcherGoldfarbShanno (const double epsilon, const std::size_t maxIteration) |
| |
| ublas::vector< double > | operator() (const ublas::vector< double > &x0, const function_type &f, const std::shared_ptr< ILineSearcher > searcher) |
| | solve $\mathrm{argmin}_{x}f(x) More...
|
| |
| const IQuasiNewton< T > & | cast () |
| |
| bool | operator== (const IQuasiNewton< T > &o) const |
| |
| std::shared_ptr< IQuasiNewton< T > > | clone () const |
| |
|
|
ublas::vector< double > | doOperatorParenthesis (const ublas::vector< double > &x0, const function_type &f, const std::shared_ptr< ILineSearcher > searcher) |
| |
| ublas::matrix< double > | calculateInverseHessian (const ublas::vector< double > &x1, const ublas::vector< double > &x2, const ublas::vector< double > &df1, const ublas::vector< double > &df2, const ublas::matrix< double > &H) |
| | calculates inverse hessian by follwoing formula: $$ B_{k+1}^{-1} := \left(I - \frac{dx_{k} y_{k}^{T}}{y_{k}^{T}dx_{k}} \right) B_{k}^{-1} \left( I - \frac{y_{k}dx_{k}^{T}}{y_{k}^{T}dx_{k}}\right) + \frac{dx_{k}dx^{T}}{y_{k}^{T}s_{k}}. $$ Here $B_{k}$ is $k$-th hessian, $dx_{k} := x_{k+1} - x_{k}$, $I$ is identity matrix, $y_{k} := df_{k+1} - df_{k}.$ Following formula is derived from above equation. $$ B_{k+1}^{-1} = \frac{B_{k}^{-1} + (dx_{k}^{T}y_{k} + y_{k}^{T}B_{k}^{-1}y_{k})(dx_{k}dx_{k}^{T})}{(dx_{k}^{T}y_{k})^{2}} - \frac{B_{k}^{-1}y_{k}dx_{k}^{T} + dx_{k}y_{k}^{T}B_{k}^{-1}}{dx_{k}^{T}y_{k}}. $$ More...
|
| |
| bool | isConverge (const ublas::vector< double > &x1, const ublas::vector< double > &x2) |
| | Check whether algorithm is converged or not. More...
|
| |
|
|
const double | _epsilon |
| |
|
const std::size_t | _maxIteration |
| |
- Parameters
-
| epsilon | algorithm is converged if error is less than epsilon. |
| maxIteration | algorithm is iterated until converged or number of maxInteration. |
template<typename T >
| template ublas::matrix< double > algo::qn::BroydenFletcherGoldfarbShanno< T >::calculateInverseHessian |
( |
const ublas::vector< double > & |
x1, |
|
|
const ublas::vector< double > & |
x2, |
|
|
const ublas::vector< double > & |
df1, |
|
|
const ublas::vector< double > & |
df2, |
|
|
const ublas::matrix< double > & |
H |
|
) |
| |
|
private |
calculates inverse hessian by follwoing formula: $$ B_{k+1}^{-1} := \left(I - \frac{dx_{k} y_{k}^{T}}{y_{k}^{T}dx_{k}} \right) B_{k}^{-1} \left( I - \frac{y_{k}dx_{k}^{T}}{y_{k}^{T}dx_{k}}\right) + \frac{dx_{k}dx^{T}}{y_{k}^{T}s_{k}}. $$ Here $B_{k}$ is $k$-th hessian, $dx_{k} := x_{k+1} - x_{k}$, $I$ is identity matrix, $y_{k} := df_{k+1} - df_{k}.$ Following formula is derived from above equation. $$ B_{k+1}^{-1} = \frac{B_{k}^{-1} + (dx_{k}^{T}y_{k} + y_{k}^{T}B_{k}^{-1}y_{k})(dx_{k}dx_{k}^{T})}{(dx_{k}^{T}y_{k})^{2}} - \frac{B_{k}^{-1}y_{k}dx_{k}^{T} + dx_{k}y_{k}^{T}B_{k}^{-1}}{dx_{k}^{T}y_{k}}. $$
- Todo:
- check the first equation is correct or not.
- Parameters
-
| x1 | previous value. |
| x2 | current value. |
| df1 | |
| df2 | |
| H | previous inverse hessian. |
- Returns
- inverse hessian.
Check whether algorithm is converged or not.
- Parameters
-
| x1 | previous value. |
| x2 | current value. |
- Returns
- true if algorithm is converged.
The documentation for this class was generated from the following files: