shark::MarkovChain< Operator > Class Template Reference

A single Markov chain. More...

#include <shark/Unsupervised/RBM/Sampling/MarkovChain.h>

Public Types

typedef Operator::RBM RBM
 The type of the RBM the operator is working with. More...
 
typedef Batch< detail::MarkovChainSample< HiddenSample, VisibleSample > >::type 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

 MarkovChain (RBM *rbm)
 Constructor. More...
 
void setBatchSize (std::size_t batchSize)
 Sets the number of parallel samples to be evaluated. More...
 
std::size_t batchSize ()
 
void initializeChain (Data< RealVector > const &dataSet)
 Initializes with data points drawn uniform from the set. More...
 
void initializeChain (RealMatrix const &sampleData)
 Initializes with data points from a batch of points. More...
 
void step (unsigned int numberOfSteps)
 Runs the chain for a given number of steps. More...
 
const_reference sample () const
 Returns the current sample of the Markov chain. More...
 
SampleBatch const & samples () const
 Returns the current batch of samples of the Markov chain. More...
 
SampleBatchsamples ()
 Returns the current batch of samples of the Markov chain. More...
 
Operator const & transitionOperator () const
 Returns the transition operator of the Markov chain. More...
 
Operator & transitionOperator ()
 Returns the transition operator of the Markov chain. More...
 

Static Public Attributes

static const bool computesBatch = true
 The MarkovChain can be used to compute several samples at once. More...
 

Detailed Description

template<class Operator>
class shark::MarkovChain< Operator >

A single Markov chain.

You can run the Markov chain for some sampling steps by applying a transition operator.

Definition at line 43 of file MarkovChain.h.

Member Typedef Documentation

◆ const_reference

template<class Operator >
typedef SampleBatch::const_reference shark::MarkovChain< Operator >::const_reference

Immutable reference to an element of the batch.

Definition at line 61 of file MarkovChain.h.

◆ RBM

template<class Operator >
typedef Operator::RBM shark::MarkovChain< Operator >::RBM

The type of the RBM the operator is working with.

Definition at line 53 of file MarkovChain.h.

◆ reference

template<class Operator >
typedef SampleBatch::reference shark::MarkovChain< Operator >::reference

Mutable reference to an element of the batch.

Definition at line 58 of file MarkovChain.h.

◆ SampleBatch

template<class Operator >
typedef Batch<detail::MarkovChainSample<HiddenSample,VisibleSample> >::type shark::MarkovChain< Operator >::SampleBatch

A batch of samples containing hidden and visible samples as well as the energies.

Definition at line 55 of file MarkovChain.h.

Constructor & Destructor Documentation

◆ MarkovChain()

template<class Operator >
shark::MarkovChain< Operator >::MarkovChain ( RBM rbm)
inline

Constructor.

Definition at line 70 of file MarkovChain.h.

Member Function Documentation

◆ batchSize()

template<class Operator >
std::size_t shark::MarkovChain< Operator >::batchSize ( )
inline

Definition at line 79 of file MarkovChain.h.

◆ initializeChain() [1/2]

template<class Operator >
void shark::MarkovChain< Operator >::initializeChain ( Data< RealVector > const &  dataSet)
inline

Initializes with data points drawn uniform from the set.

Parameters
dataSetthe data set

Definition at line 86 of file MarkovChain.h.

◆ initializeChain() [2/2]

template<class Operator >
void shark::MarkovChain< Operator >::initializeChain ( RealMatrix const &  sampleData)
inline

Initializes with data points from a batch of points.

Parameters
sampleDataData set

Definition at line 99 of file MarkovChain.h.

◆ sample()

template<class Operator >
const_reference shark::MarkovChain< Operator >::sample ( ) const
inline

Returns the current sample of the Markov chain.

Definition at line 111 of file MarkovChain.h.

◆ samples() [1/2]

template<class Operator >
SampleBatch const& shark::MarkovChain< Operator >::samples ( ) const
inline

Returns the current batch of samples of the Markov chain.

Definition at line 116 of file MarkovChain.h.

◆ samples() [2/2]

template<class Operator >
SampleBatch& shark::MarkovChain< Operator >::samples ( )
inline

Returns the current batch of samples of the Markov chain.

Definition at line 121 of file MarkovChain.h.

◆ setBatchSize()

template<class Operator >
void shark::MarkovChain< Operator >::setBatchSize ( std::size_t  batchSize)
inline

Sets the number of parallel samples to be evaluated.

Definition at line 74 of file MarkovChain.h.

◆ step()

template<class Operator >
void shark::MarkovChain< Operator >::step ( unsigned int  numberOfSteps)
inline

Runs the chain for a given number of steps.

Parameters
numberOfStepsthe number of steps

Definition at line 106 of file MarkovChain.h.

◆ transitionOperator() [1/2]

template<class Operator >
Operator const& shark::MarkovChain< Operator >::transitionOperator ( ) const
inline

Returns the transition operator of the Markov chain.

Definition at line 126 of file MarkovChain.h.

◆ transitionOperator() [2/2]

template<class Operator >
Operator& shark::MarkovChain< Operator >::transitionOperator ( )
inline

Returns the transition operator of the Markov chain.

Definition at line 131 of file MarkovChain.h.

Member Data Documentation

◆ computesBatch

template<class Operator >
const bool shark::MarkovChain< Operator >::computesBatch = true
static

The MarkovChain can be used to compute several samples at once.

Definition at line 50 of file MarkovChain.h.


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