KJB
|
#include <sample_sampler.h>
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 >)) | |
Single_step_sampler (const Step &step, const Model &initial_state, double initial_log_target) | |
Constructs an object of this type from a MH step. More... | |
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 Step & | choose_step () const |
Returns the step given in the constructor. More... | |
Model | The model type. Must comply with BaseModel concept. |
A sampler with a single step type. In other words, the choose_step member function simply returns the same step.
typedef Abstract_sampler<Model> Single_step_sampler< Model >::Parent |
typedef Abstract_sampler<Model>::Step Single_step_sampler< Model >::Step |
|
inline |
Constructs an object of this type from a MH step.
step | The Basic_mh_step that this sampler will run. |
initial_state | The model to intialize the sample with |
initial_log_target | The log probability of the initial_state model under the target distribution. |
Single_step_sampler< Model >::BOOST_CONCEPT_ASSERT | ( | (BaseModel< Model >) | ) |
|
inlineprotectedvirtual |
Returns the step given in the constructor.
Implements Abstract_sampler< Model >.