KJB
|
Approximates the gradient and/or curvature of a target distribution, evaluated at a certain location. The user must provide the mechanisms to change the model (see constructor). More...
#include <sample_default.h>
Public Types | |
typedef Model_evaluator< Model > ::Type | Target_distribution |
typedef Move_model_parameter < Model >::Type | Move_parameter |
typedef Model_parameter_evaluator < Model >::Type | Get_neighborhood |
typedef Model_dimension< Model > ::Type | Get_dimension |
Public Member Functions | |
Numerical_gradient (const Target_distribution &log_target, const Move_parameter &move_param, const Get_neighborhood &get_neighbors, const Get_dimension &get_dim) | |
Construct a gradient approximation functor. More... | |
kjb::Vector | operator() (const Model &q) const |
Evaluates gradient at q. More... | |
kjb::Vector | curvature (const Model &q) const |
kjb::Vector | gradient (const Model &q) const |
void | gradient_and_curvature (const Model &q, kjb::Vector &gradient, kjb::Vector &curvature) const |
Approximates the gradient and/or curvature of a target distribution, evaluated at a certain location. The user must provide the mechanisms to change the model (see constructor).
typedef Model_dimension<Model>::Type Numerical_gradient< Model >::Get_dimension |
typedef Model_parameter_evaluator<Model>::Type Numerical_gradient< Model >::Get_neighborhood |
typedef Move_model_parameter<Model>::Type Numerical_gradient< Model >::Move_parameter |
typedef Model_evaluator<Model>::Type Numerical_gradient< Model >::Target_distribution |
|
inline |
Construct a gradient approximation functor.
log_target | The log of the target distribution. |
move_param | Mechanism to 'move' a parameter of the model by a delta. |
get_neighbors | Mechamisn to get the neighborhood of the current model location. We allow this to be a function of the current model. |
get_dim | Mechanism to obtain the dimension of the model. |
|
inline |
|
inline |
|
inline |
|
inline |
Evaluates gradient at q.