Implements parallel tempering but also stores additional statistics on the energy differences. More...
#include <shark/Unsupervised/RBM/Sampling/EnergyStoringTemperedMarkovChain.h>
Public Types | |
typedef Operator::RBM | RBM |
The type of the RBM the operator is working with. More... | |
typedef TemperedMarkovChain< Operator >::SampleBatch | SampleBatch |
A batch of samples containing hidden and visible samples as well as the energies. More... | |
typedef SampleBatch::reference | reference |
Mutable reference to an element of the batch. More... | |
typedef SampleBatch::const_reference | const_reference |
Immutable reference to an element of the batch. More... | |
Public Member Functions | |
EnergyStoringTemperedMarkovChain (RBM *rbm, bool integrateEnergyDifferences=true) | |
const Operator & | transitionOperator () const |
Operator & | transitionOperator () |
void | setNumberOfTemperatures (std::size_t temperatures) |
void | setUniformTemperatureSpacing (std::size_t temperatures) |
std::size_t | numberOfTemperatures () const |
Returns the number Of temperatures. More... | |
void | setBatchSize (std::size_t batchSize) |
std::size_t | batchSize () |
void | setBeta (std::size_t i, double beta) |
double | beta (std::size_t i) const |
RealVector const & | beta () const |
const_reference | sample () const |
Returns the current state of the chain for beta = 1. More... | |
SampleBatch const & | samples () const |
Returns the current state of the chain for all beta values. More... | |
SampleBatch & | samples () |
Returns the current batch of samples of the Markov chain. More... | |
void | initializeChain (Data< RealVector > const &dataSet) |
Initializes the markov chain using samples drawn uniformly from the set. More... | |
void | initializeChain (RealMatrix const &sampleData) |
Initializes with data points from a batch of points. More... | |
void | step (unsigned int k) |
RealMatrix | getUpDifferences () const |
RealMatrix | getDownDifferences () const |
void | resetDifferences () |
bool & | storeEnergyDifferences () |
void | update () |
Static Public Attributes | |
static const bool | computesBatch = false |
The MarkovChain can't be used to compute several samples at once. More... | |
Implements parallel tempering but also stores additional statistics on the energy differences.
Definition at line 40 of file EnergyStoringTemperedMarkovChain.h.
typedef SampleBatch::const_reference shark::EnergyStoringTemperedMarkovChain< Operator >::const_reference |
Immutable reference to an element of the batch.
Definition at line 62 of file EnergyStoringTemperedMarkovChain.h.
typedef Operator::RBM shark::EnergyStoringTemperedMarkovChain< Operator >::RBM |
The type of the RBM the operator is working with.
Definition at line 53 of file EnergyStoringTemperedMarkovChain.h.
typedef SampleBatch::reference shark::EnergyStoringTemperedMarkovChain< Operator >::reference |
Mutable reference to an element of the batch.
Definition at line 59 of file EnergyStoringTemperedMarkovChain.h.
typedef TemperedMarkovChain<Operator>::SampleBatch shark::EnergyStoringTemperedMarkovChain< Operator >::SampleBatch |
A batch of samples containing hidden and visible samples as well as the energies.
Definition at line 56 of file EnergyStoringTemperedMarkovChain.h.
|
inline |
Definition at line 74 of file EnergyStoringTemperedMarkovChain.h.
|
inline |
Definition at line 102 of file EnergyStoringTemperedMarkovChain.h.
|
inline |
Definition at line 110 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::beta().
|
inline |
Definition at line 114 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::beta().
Referenced by shark::EnergyStoringTemperedMarkovChain< Operator >::getDownDifferences(), shark::EnergyStoringTemperedMarkovChain< Operator >::getUpDifferences(), and shark::EnergyStoringTemperedMarkovChain< Operator >::step().
|
inline |
Definition at line 202 of file EnergyStoringTemperedMarkovChain.h.
References shark::EnergyStoringTemperedMarkovChain< Operator >::beta().
|
inline |
Definition at line 195 of file EnergyStoringTemperedMarkovChain.h.
References shark::EnergyStoringTemperedMarkovChain< Operator >::beta().
|
inline |
Initializes the markov chain using samples drawn uniformly from the set.
dataSet | the data set |
Definition at line 135 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::initializeChain().
|
inline |
Initializes with data points from a batch of points.
sampleData | the data set |
Definition at line 142 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::initializeChain().
|
inline |
Returns the number Of temperatures.
Definition at line 95 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::numberOfTemperatures().
|
inline |
Definition at line 210 of file EnergyStoringTemperedMarkovChain.h.
|
inline |
Returns the current state of the chain for beta = 1.
Definition at line 119 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::sample().
|
inline |
Returns the current state of the chain for all beta values.
Definition at line 123 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::samples().
|
inline |
Returns the current batch of samples of the Markov chain.
Definition at line 128 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::samples().
|
inline |
Definition at line 99 of file EnergyStoringTemperedMarkovChain.h.
References SHARK_RUNTIME_CHECK.
|
inline |
Definition at line 106 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::setBeta().
|
inline |
Definition at line 87 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::setNumberOfTemperatures().
|
inline |
Definition at line 90 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::setUniformTemperatureSpacing().
|
inline |
Definition at line 146 of file EnergyStoringTemperedMarkovChain.h.
References shark::EnergyStoringTemperedMarkovChain< Operator >::beta(), shark::TemperedMarkovChain< Operator >::step(), shark::EnergyStoringTemperedMarkovChain< Operator >::storeEnergyDifferences(), and shark::EnergyStoringTemperedMarkovChain< Operator >::transitionOperator().
|
inline |
Definition at line 215 of file EnergyStoringTemperedMarkovChain.h.
Referenced by shark::EnergyStoringTemperedMarkovChain< Operator >::step().
|
inline |
Definition at line 80 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::transitionOperator().
Referenced by shark::EnergyStoringTemperedMarkovChain< Operator >::step().
|
inline |
Definition at line 83 of file EnergyStoringTemperedMarkovChain.h.
References shark::TemperedMarkovChain< Operator >::transitionOperator().
|
inline |
Definition at line 221 of file EnergyStoringTemperedMarkovChain.h.
|
static |
The MarkovChain can't be used to compute several samples at once.
The tempered markov chain ues it's batch capabilities allready to compute the samples for all temperatures At the same time. Also it is much more powerfull when all samples are drawn one after another for a higher mixing rate.
Definition at line 50 of file EnergyStoringTemperedMarkovChain.h.