TMB Documentation
v1.9.11
|
Highly flexible atomic Newton()
solver and Laplace()
approximation.
More...
Classes | |
struct | HessianSolveVector |
Operator (H, x) -> solve(H, x) More... | |
struct | jacobian_dense_t |
Methods specific for a dense hessian. More... | |
struct | jacobian_sparse_plus_lowrank_t |
Methods specific for a sparse plus low rank hessian. More... | |
struct | jacobian_sparse_t |
Methods specific for a sparse hessian. More... | |
struct | newton_config |
Newton configuration parameters. More... | |
struct | NewtonOperator |
Generalized newton solver similar to TMB R function 'newton'. More... | |
struct | safe_eval |
struct | TagOp |
Operator to mark intermediate variables on the tape. More... | |
Functions | |
template<class Functor , class Type > | |
Type | Laplace (Functor &F, Eigen::Array< Type, Eigen::Dynamic, 1 > &start, newton_config cfg=newton_config()) |
Tape a functor and return Laplace Approximation. More... | |
template<class Functor , class Type > | |
vector< Type > | Newton (Functor &F, Eigen::Array< Type, Eigen::Dynamic, 1 > start, newton_config cfg=newton_config()) |
Tape a functor and return solution. More... | |
TMBad::ad_plain | Tag (const TMBad::ad_plain &x) |
Mark a variable during taping. More... | |
TMBad::Scalar | Tag (const TMBad::Scalar &x) |
Otherwise ignore marks. | |
Highly flexible atomic Newton()
solver and Laplace()
approximation.
TMBAD_SUPERNODAL
).Type newton::Laplace | ( | Functor & | F, |
Eigen::Array< Type, Eigen::Dynamic, 1 > & | start, | ||
newton_config | cfg = newton_config() |
||
) |
Tape a functor and return Laplace Approximation.
Can be used anywhere in a template. Inner and outer parameters are automatically detected.
F | Function to minimize |
start | Vector with initial guess |
cfg | Configuration parameters for solver |
start
is passed by reference and contains the inner problem mode on output Definition at line 1382 of file newton.hpp.
vector<Type> newton::Newton | ( | Functor & | F, |
Eigen::Array< Type, Eigen::Dynamic, 1 > | start, | ||
newton_config | cfg = newton_config() |
||
) |
Tape a functor and return solution.
Can be used anywhere in a template. Inner and outer parameters are automatically detected.
F | Function to minimize |
start | Vector with initial guess |
cfg | Configuration parameters for solver |
Definition at line 1354 of file newton.hpp.
TMBad::ad_plain newton::Tag | ( | const TMBad::ad_plain & | x | ) |
Mark a variable during taping.
The 'sparse plus low rank' Hessian (jacobian_sparse_plus_lowrank_t
) requires the user to manually mark variables used to identify the low rank contribution.
For any intermediate variable s(x)
we can write the objective function f(x)
as f(x,s(x))
. The hessian takes the form
where the first term is referred to as a 'lowrank contribution' and R(x)
is the remainder term. The user must choose s(x)
in a way such that the remainder term becomes a sparse matrix. A good heuristic is (which you'll see by expanding the remainder term):
s(x)
that links to many random effectss(x)
such that hessian(s)
is sparseExample (incomplete) of use: