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

#include <sample_sampler.h>

Inheritance diagram for Multi_step_sampler< Model >:
Abstract_sampler< Model > Annealing_sampler< Model >

Classes

struct  null_deleter
 

Public Types

typedef Abstract_sampler< Model > Parent
 
typedef Abstract_sampler
< Model >::Step 
Step
 
- Public Types inherited from Abstract_sampler< Model >
typedef Sampler_step< Model >::Type Step
 
typedef Model Model_type
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((BaseModel< Model >))
 
 Multi_step_sampler (const Model &initial_state, double initial_log_target)
 
template<class StepType >
 Multi_step_sampler (const StepType &st, const Model &initial_state, double initial_log_target)
 
 Multi_step_sampler (const std::vector< Step > &step_list, const std::vector< double > &prob_list, const Model &initial_state, double initial_log_target)
 
template<class StepType >
void add_step (const StepType &step, double prob, const std::string &name="")
 Add a new step with associated probability. This does NOT make sure probabilities add up to 1. It is up to the user to do that. More...
 
template<class StepType >
void add_step (StepType *step, double prob, const std::string &name="")
 Add a new step with associated probability. This does NOT make sure probabilities add up to 1. It is up to the user to do that. More...
 
template<class StepType >
void add_step (const boost::shared_ptr< StepType > &step, double prob, const std::string &name="")
 Add a new step with associated probability. This does NOT make sure probabilities add up to 1. It is up to the user to do that. More...
 
template<class StepType >
const StepType & get_step (size_t i) const
 
- Public Member Functions inherited from Abstract_sampler< Model >
 Abstract_sampler (const Model &initial_state, double initial_log_target)
 
 BOOST_CONCEPT_ASSERT ((BaseModel< Model >))
 
virtual void run (int num_iterations)
 Runs the sampler. This function runs the sampler for the indicated number of iterations. At each iteration it chooses a sampler step using choose_step() and invokes it using its operator(). The best model is saved and returned. More...
 
Model & current_state ()
 
const Model & current_state () const
 
double current_log_target () const
 
template<class Recorder >
void add_recorder (Recorder r)
 
template<class Recorder >
void add_recorder (Recorder *r)
 
template<class Callback >
void add_record_callback (Callback cb)
 
template<class Recorder >
const Recorder & get_recorder (size_t i) const
 
void if_accept (const Callback &cb)
 
void if_reject (const Callback &cb)
 
void on_accept (const Callback &cb)
 
void on_reject (const Callback &cb)
 

Protected Member Functions

virtual const Stepchoose_step () const
 Chooses a sampler step. Pure virtual method, should be overwritten. More...
 

Detailed Description

template<typename Model>
class Multi_step_sampler< Model >

Template Parameters
ModelThe model type. Must comply with BaseModel concept.

A sampler that chooses from a set of moves distributed under a categorical distribution.

Member Typedef Documentation

template<typename Model >
typedef Abstract_sampler<Model> Multi_step_sampler< Model >::Parent
template<typename Model >
typedef Abstract_sampler<Model>::Step Multi_step_sampler< Model >::Step

Constructor & Destructor Documentation

template<typename Model >
Multi_step_sampler< Model >::Multi_step_sampler ( const Model &  initial_state,
double  initial_log_target 
)
inline
Parameters
initial_stateModel to initialize the sampler with
initial_log_targetLog of the value of the initial_state under the target distribution
template<typename Model >
template<class StepType >
Multi_step_sampler< Model >::Multi_step_sampler ( const StepType &  st,
const Model &  initial_state,
double  initial_log_target 
)
inline

Initialize with a single step, whose probability will be 1.0.

Parameters
stA single step to use for all iterations
initial_stateModel to initialize the sampler with
initial_log_targetLog of the value of the initial_state under the target distribution
template<typename Model >
Multi_step_sampler< Model >::Multi_step_sampler ( const std::vector< Step > &  step_list,
const std::vector< double > &  prob_list,
const Model &  initial_state,
double  initial_log_target 
)
inline

Initialize with a list of steps and associated probabilities

Parameters
stA single step to use for all iterations
initial_stateModel to initialize the sampler with
initial_log_targetLog of the value of the initial_state under the target distribution

Member Function Documentation

template<typename Model >
template<class StepType >
void Multi_step_sampler< Model >::add_step ( const StepType &  step,
double  prob,
const std::string &  name = "" 
)
inline

Add a new step with associated probability. This does NOT make sure probabilities add up to 1. It is up to the user to do that.

template<typename Model >
template<class StepType >
void Multi_step_sampler< Model >::add_step ( StepType *  step,
double  prob,
const std::string &  name = "" 
)
inline

Add a new step with associated probability. This does NOT make sure probabilities add up to 1. It is up to the user to do that.

template<typename Model >
template<class StepType >
void Multi_step_sampler< Model >::add_step ( const boost::shared_ptr< StepType > &  step,
double  prob,
const std::string &  name = "" 
)
inline

Add a new step with associated probability. This does NOT make sure probabilities add up to 1. It is up to the user to do that.

template<typename Model >
Multi_step_sampler< Model >::BOOST_CONCEPT_ASSERT ( (BaseModel< Model >)  )
template<typename Model >
virtual const Step& Multi_step_sampler< Model >::choose_step ( ) const
inlineprotectedvirtual

Chooses a sampler step. Pure virtual method, should be overwritten.

Implements Abstract_sampler< Model >.

template<typename Model >
template<class StepType >
const StepType& Multi_step_sampler< Model >::get_step ( size_t  i) const
inline

Retrieve step


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