KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE > Class Template Reference

#include <sample_vector.h>

Inheritance diagram for Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >:
Basic_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE > Abstract_hmc_step< Model, CONSTRAINED_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >

Public Types

typedef Basic_hmc_step< Model,
CONSTRAIN_TARGET,
INCLUDE_ACCEPT_STEP,
REVERSIBLE > 
Parent
 
typedef Parent::Target_distribution Target_distribution
 
typedef Parent::Gradient Gradient
 
typedef Parent::Get_step_size Get_step_size
 
typedef Parent::Get_lower_bounds Get_lower_bounds
 
typedef Parent::Get_upper_bounds Get_upper_bounds
 
- Public Types inherited from Basic_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >
typedef Abstract_hmc_step
< Model, CONSTRAINED_TARGET,
INCLUDE_ACCEPT_STEP,
REVERSIBLE > 
Parent
 
typedef Parent::Target_distribution Target_distribution
 
typedef Parent::Gradient Gradient
 
typedef Parent::Move_parameter Move_parameter
 
typedef Parent::Get_step_size Get_step_size
 
typedef Parent::Get_dimension Get_dimension
 
typedef Parent::Get_parameter Get_parameter
 
typedef Parent::Get_lower_bounds Get_lower_bounds
 
typedef Parent::Get_upper_bounds Get_upper_bounds
 
- Public Types inherited from Abstract_hmc_step< Model, CONSTRAINED_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >
typedef Model_evaluator< Model >
::Type 
Target_distribution
 
typedef
Model_parameter_evaluator
< Model >::Type 
Gradient
 
typedef Move_model_parameter
< Model >::Type 
Move_parameter
 
typedef
Model_parameter_evaluator
< Model >::Type 
Get_step_size
 
typedef Model_dimension< Model >
::Type 
Get_dimension
 
typedef Get_model_parameter
< Model >::Type 
Get_parameter
 
typedef
Model_parameter_evaluator
< Model >::Type 
Get_lower_bounds
 
typedef
Model_parameter_evaluator
< Model >::Type 
Get_upper_bounds
 

Public Member Functions

 Vector_hmc_step (const Target_distribution &log_target, int num_dynamics_steps, const Gradient &gradient, const Get_step_size &get_step_size, double alpha=0.0)
 Creates a Vector_hmc_step. More...
 
 Vector_hmc_step (const Target_distribution &log_target, int num_dynamics_steps, const Gradient &gradient, const Get_step_size &get_step_size, const Get_lower_bounds &get_lower_bounds, const Get_upper_bounds &get_upper_bounds, double alpha=0.0)
 
virtual ~Vector_hmc_step ()
 
- Public Member Functions inherited from Basic_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >
 Basic_hmc_step (const Target_distribution &log_target, int num_dynamics_steps, const Gradient &gradient, const Move_parameter &move_parameter, const Get_step_size &get_step_size, const Get_dimension &get_dimension, double alpha=0.0)
 Creates a Basic_hmc_step by initializing target and proposer functors (or functions) to the given arguments. More...
 
 Basic_hmc_step (const Target_distribution &log_target, int num_dynamics_steps, const Gradient &gradient, const Move_parameter &move_parameter, const Get_step_size &get_step_size, const Get_dimension &get_dimension, const Get_parameter &get_parameter, const Get_lower_bounds &get_lower_bounds, const Get_upper_bounds &get_upper_bounds, double alpha=0.0)
 
void record_extra (bool enable)
 
virtual bool record_extra () const
 if true is returned, the step log will contain metadata about the step More...
 
void set_post_move_callback (const boost::function2< void, Model &, kjb::Vector & > &f)
 Copy-constructor. More...
 
virtual ~Basic_hmc_step ()
 
virtual const Target_distributionget_log_target () const
 Returns a reference to the target distribution. Returned object must comply with the ModelEvaluator concept. More...
 
virtual const Gradientget_gradient () const
 Returns a reference to the mechanism to compute the gradient of the target distribution. More...
 
virtual const Move_parameterget_move_parameter () const
 Returns a reference to the parameter-changing mechanism. Must comply with the ChangeParameter concept. More...
 
virtual const Get_step_sizeget_step_size_function () const
 Returns a reference to the mechanism for choosing the neighborhoods for each parameters. More...
 
virtual const Get_dimensionget_dimension_function () const
 Returns a reference to the mechanism for computing the dimension of the model. More...
 
virtual const Get_parameterget_parameter_function () const
 Returns a reference to the mechanism for getting the value of a dimension of the model. More...
 
virtual const Get_lower_boundsget_lower_bounds_function () const
 Returns a reference to the mechanism for getting the lower bounds of a function. More...
 
virtual const Get_upper_boundsget_upper_bounds_function () const
 Returns a reference to the mechanism for getting the upper bounds of a function. More...
 
virtual void post_move_callback (Model &q, kjb::Vector &p) const
 
- Public Member Functions inherited from Abstract_hmc_step< Model, CONSTRAINED_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >
 BOOST_CONCEPT_ASSERT ((BaseModel< Model >))
 
 Abstract_hmc_step (int num_dynamics_steps, double alpha)
 
bool is_first_p_full (const bool alpha, const bool accept_step, const bool reversible)
 
bool is_last_p_ignored (const bool alpha, const bool accept_step, const bool reversible)
 
 Abstract_hmc_step (const Abstract_hmc_step &ahs)
 
virtual Step_log< Model > operator() (Model &q, double lt_q) const
 Runs a step of Hybrid Monte-Carlo (HMC) on a model m. More...
 
void set_temperature (const double T)
 
virtual ~Abstract_hmc_step ()
 

Additional Inherited Members

- Protected Attributes inherited from Basic_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >
Target_distribution m_log_target
 
Gradient m_gradient
 
Move_parameter m_move_parameter
 
Get_step_size m_get_step_size
 
Get_dimension m_get_dimension
 
bool m_record_extra
 
Get_parameter m_get_parameter
 
Get_lower_bounds m_get_lower_bounds
 
Get_upper_bounds m_get_upper_bounds
 
boost::function2< void, Model
&, kjb::Vector & > 
m_post_move_callback
 
- Protected Attributes inherited from Abstract_hmc_step< Model, CONSTRAINED_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >
const int m_num_dynamics_steps
 The number of leapfrog steps in the trajectory, "choosing a suitable trajectory length is crucial if HMC is to explore the stae space systematically, rather than by a random walk". "For a problem thought to be airly difficult, a trajectory with m_length = 100 might be a suitable starting point. More...
 
double m_alpha
 Amount of stochastic update to apply to momentum. Set to zero for strict HMC. More...
 
kjb::Vector p
 Momentum. More...
 
bool m_first_p_full
 Optimization constants. Set to false for true MCMC. More...
 
bool m_last_p_ignore
 
double m_temperature
 

Detailed Description

template<typename Model, bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
class Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >

Template Parameters
ModelThe model type. Must comply with VectorModel concept; i.e.,. must have [] and .size() defined and its elements must be convertible to double.

Vector_hmc_step is a functor that runs a single step of hybrid Monte Carlo on a vector model

Member Typedef Documentation

template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
typedef Parent::Get_lower_bounds Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Get_lower_bounds
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
typedef Parent::Get_step_size Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Get_step_size
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
typedef Parent::Get_upper_bounds Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Get_upper_bounds
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
typedef Parent::Gradient Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Gradient
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
typedef Basic_hmc_step<Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE> Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Parent
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
typedef Parent::Target_distribution Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Target_distribution

Constructor & Destructor Documentation

template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Vector_hmc_step ( const Target_distribution log_target,
int  num_dynamics_steps,
const Gradient gradient,
const Get_step_size get_step_size,
double  alpha = 0.0 
)
inline

Creates a Vector_hmc_step.

Parameters
log_targetTarget_distribution object used to initialize internal target distribution used in operator().
num_dynamics_stepsNumber of dynamics steps to take before accepting/rejecting.
gradientMechanism to compute the gradient of the (log) target distribution.
get_step_sizeMechanism to get the step sizes for the leap frog algorithm.
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::Vector_hmc_step ( const Target_distribution log_target,
int  num_dynamics_steps,
const Gradient gradient,
const Get_step_size get_step_size,
const Get_lower_bounds get_lower_bounds,
const Get_upper_bounds get_upper_bounds,
double  alpha = 0.0 
)
inline
template<typename Model , bool CONSTRAIN_TARGET = false, bool INCLUDE_ACCEPT_STEP = true, bool REVERSIBLE = true>
virtual Vector_hmc_step< Model, CONSTRAIN_TARGET, INCLUDE_ACCEPT_STEP, REVERSIBLE >::~Vector_hmc_step ( )
inlinevirtual

The documentation for this class was generated from the following file: