Fleet  0.0.9
Inference in the LOT
Public Member Functions | Public Attributes | List of all members
ParallelTempering< HYP > Class Template Reference

#include <ParallelTempering.h>

Inheritance diagram for ParallelTempering< HYP >:
Inheritance graph
[legend]
Collaboration diagram for ParallelTempering< HYP >:
Collaboration graph
[legend]

Public Member Functions

 ParallelTempering (HYP &h0, typename HYP::data_t *d, std::initializer_list< double > t)
 
 ParallelTempering (HYP &h0, typename HYP::data_t *d, unsigned long n, double maxT)
 
void __swapper_thread ()
 
void __adapter_thread ()
 
generator< HYP & > run (Control ctl)
 
void show_statistics ()
 
double k (unsigned long t, double v, double t0)
 
void adapt (double v=3, double t0=1000000)
 
- Public Member Functions inherited from ChainPool< HYP >
 ChainPool ()
 
 ChainPool (HYP &h0, typename HYP::data_t *d, size_t n)
 
void set_data (typename HYP::data_t *d, bool recompute=true)
 Set this data. More...
 
generator< HYP & > run_thread (Control &ctl) override
 This run helper is called internally by multiple different threads, and runs a given pool. More...
 
- Public Member Functions inherited from ThreadedInferenceInterface< HYP >
virtual generator< HYP &> run_thread (Control &ctl, Args... args)=0
 
 ThreadedInferenceInterface ()
 
unsigned long next_index ()
 Return the next index to operate on (in a thread-safe way). More...
 
size_t nthreads ()
 How many threads are currently run in this interface? More...
 
void run_thread_generator_wrapper (size_t thr, Control &ctl, Args... args)
 We have to wrap run_thread in something that manages the sync with main. This really just synchronizes the output of run_thread with run below. NOTE this makes a copy of x into the local next_x, so that when the thread keeps running, it doesn't mess anything up. We may in the future block the thread and return a reference, but its not clear that's faster. More...
 
generator< HYP &> run (Control ctl, Args... args)
 Set up the multiple threads and actually run, calling run_thread_generator_wrapper. More...
 
generator< HYP &> unthreaded_run (Control ctl, Args... args)
 

Public Attributes

time_ms swap_every = 250
 
time_ms adapt_every = 5000
 
OrderedLock overall_mutex
 
std::vector< double > temperatures
 
std::vector< FiniteHistory< bool > > swap_history
 
bool is_temperature
 
std::atomic< bool > terminate
 
- Public Attributes inherited from ChainPool< HYP >
std::vector< MCMCChain< HYP > > pool
 
unsigned long steps_before_change = 100
 
std::vector< RunningStaterunning
 
OrderedLock running_lock
 
- Public Attributes inherited from ThreadedInferenceInterface< HYP >
std::atomic< size_t > index
 
size_t __nthreads
 
std::atomic< size_t > __nrunning
 
ConcurrentQueue< HYP > to_yield
 

Additional Inherited Members

- Public Types inherited from ChainPool< HYP >
enum  RunningState { RunningState::READY, RunningState::RUNNING, RunningState::DONE }
 

Detailed Description

template<typename HYP>
class ParallelTempering< HYP >

Author
piantado
Date
10/06/20

Constructor & Destructor Documentation

◆ ParallelTempering() [1/2]

template<typename HYP >
ParallelTempering< HYP >::ParallelTempering ( HYP &  h0,
typename HYP::data_t *  d,
std::initializer_list< double >  t 
)
inline

◆ ParallelTempering() [2/2]

template<typename HYP >
ParallelTempering< HYP >::ParallelTempering ( HYP &  h0,
typename HYP::data_t *  d,
unsigned long  n,
double  maxT 
)
inline

Member Function Documentation

◆ __adapter_thread()

template<typename HYP >
void ParallelTempering< HYP >::__adapter_thread ( )
inline

◆ __swapper_thread()

template<typename HYP >
void ParallelTempering< HYP >::__swapper_thread ( )
inline

◆ adapt()

template<typename HYP >
void ParallelTempering< HYP >::adapt ( double  v = 3,
double  t0 = 1000000 
)
inline

◆ k()

template<typename HYP >
double ParallelTempering< HYP >::k ( unsigned long  t,
double  v,
double  t0 
)
inline

◆ run()

template<typename HYP >
generator<HYP&> ParallelTempering< HYP >::run ( Control  ctl)
inline

◆ show_statistics()

template<typename HYP >
void ParallelTempering< HYP >::show_statistics ( )
inline

Member Data Documentation

◆ adapt_every

template<typename HYP >
time_ms ParallelTempering< HYP >::adapt_every = 5000

◆ is_temperature

template<typename HYP >
bool ParallelTempering< HYP >::is_temperature

◆ overall_mutex

template<typename HYP >
OrderedLock ParallelTempering< HYP >::overall_mutex

◆ swap_every

template<typename HYP >
time_ms ParallelTempering< HYP >::swap_every = 250

◆ swap_history

template<typename HYP >
std::vector<FiniteHistory<bool> > ParallelTempering< HYP >::swap_history

◆ temperatures

template<typename HYP >
std::vector<double> ParallelTempering< HYP >::temperatures

◆ terminate

template<typename HYP >
std::atomic<bool> ParallelTempering< HYP >::terminate

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