shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures > Class Template Reference

The structure of an RBM is defined by the neuron type of its layers and its interaction parameters. More...

#include <shark/Unsupervised/RBM/Impl/RBMStructure.h>

+ Inheritance diagram for shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >:
+ Collaboration diagram for shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >:

Public Types

typedef VectorT VectorType
 
typedef VectorMatrixTraits
< VectorType >::MatrixType 
MatrixType
 

Public Member Functions

void read (InArchive &archive)
 Reads the network from an archive. More...
 
void write (OutArchive &archive) const
 Writes the network to an archive. More...
 
void configure (const PropertyTree &node)
 Configures the network. More...
 
size_t numberOfParameters () const
 Returns the total number of parameters of the model. More...
 
RealVector parameterVector () const
 Returns the parameters of the RBM as ParameterVector. More...
 
void setParameterVector (const RealVector &newParameters)
 Sets the parameters of the RBM. More...
 
void setStructure (size_t numOfVN, size_t numOfHN)
 Creates an RBM with a specified number of visible and hidden units. More...
 
const RealMatrix & weightMatrix (std::size_t i, std::size_t j) const
 Returns the weight matrix corresponding to the i-th phi-functions of the hidden an the j-th phi-function of the visible variables. More...
 
RealMatrix & weightMatrix (std::size_t i, std::size_t j)
 Returns the weight matrix corresponding to the i-th phi-functions of the hidden an the j-th phi-function of the visible variables. More...
 
std::size_t numberOfHiddenFeatures ()
 Returns the number of phi-functions of the hidden neuron layer. More...
 
std::size_t numberOfVisibleFeatures ()
 Returns the number of phi-functions of the hidden neuron layer. More...
 
HiddenType & hiddenNeurons ()
 Returns the layer of hidden neurons. More...
 
const HiddenType & hiddenNeurons () const
 Returns the layer of hidden neurons. More...
 
VisibleType & visibleNeurons ()
 Returns the layer of visible neurons. More...
 
const VisibleType & visibleNeurons () const
 Returns the layer of visible neurons. More...
 
size_t numberOfHN () const
 Returns the number of hidden neurons. More...
 
size_t numberOfVN () const
 Returns the number of visible neurons. More...
 
- Public Member Functions inherited from shark::IParameterizable
virtual ~IParameterizable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. More...
 
void load (InArchive &archive, unsigned int version)
 Versioned loading of components, calls read(...). More...
 
void save (OutArchive &archive, unsigned int version) const
 Versioned storing of components, calls write(...). More...
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 
- Public Member Functions inherited from shark::IConfigurable
virtual ~IConfigurable ()
 Virtual d'tor. More...
 

Protected Attributes

boost::array< MatrixType,
hiddenFeatures
*visibleFeatures > 
m_weightMatrix
 
HiddenType m_hiddenNeurons
 The layer of hidden Neurons. More...
 
VisibleType m_visibleNeurons
 The Layer of visible Neurons. More...
 

Detailed Description

template<class HiddenType, class VisibleType, class VectorT, std::size_t hiddenFeatures, std::size_t visibleFeatures>
class shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >

The structure of an RBM is defined by the neuron type of its layers and its interaction parameters.

Definition at line 41 of file RBMStructure.h.

Member Typedef Documentation

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
typedef VectorMatrixTraits<VectorType>::MatrixType shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::MatrixType

Definition at line 44 of file RBMStructure.h.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
typedef VectorT shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::VectorType

Definition at line 43 of file RBMStructure.h.

Member Function Documentation

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
void shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::configure ( const PropertyTree node)
inlinevirtual
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
HiddenType& shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::hiddenNeurons ( )
inline
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
const HiddenType& shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::hiddenNeurons ( ) const
inline
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
std::size_t shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfHiddenFeatures ( )
inline

Returns the number of phi-functions of the hidden neuron layer.

Definition at line 141 of file RBMStructure.h.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
size_t shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfHN ( ) const
inline
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
std::size_t shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfVisibleFeatures ( )
inline

Returns the number of phi-functions of the hidden neuron layer.

Definition at line 146 of file RBMStructure.h.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
size_t shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfVN ( ) const
inline
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
RealVector shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::parameterVector ( ) const
inlinevirtual
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
void shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::read ( InArchive archive)
inlinevirtual
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
void shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setParameterVector ( const RealVector &  newParameters)
inlinevirtual
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
void shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setStructure ( size_t  numOfVN,
size_t  numOfHN 
)
inline
template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
VisibleType& shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::visibleNeurons ( )
inline

Returns the layer of visible neurons.

Definition at line 161 of file RBMStructure.h.

References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
const VisibleType& shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::visibleNeurons ( ) const
inline

Returns the layer of visible neurons.

Definition at line 166 of file RBMStructure.h.

References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
const RealMatrix& shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::weightMatrix ( std::size_t  i,
std::size_t  j 
) const
inline

Returns the weight matrix corresponding to the i-th phi-functions of the hidden an the j-th phi-function of the visible variables.

Parameters
iindex of the hidden phi-function
jindex of the visible phi-function

Definition at line 127 of file RBMStructure.h.

References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
RealMatrix& shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::weightMatrix ( std::size_t  i,
std::size_t  j 
)
inline

Returns the weight matrix corresponding to the i-th phi-functions of the hidden an the j-th phi-function of the visible variables.

Parameters
iindex of the hidden phi-function
jindex of the visible phi-function

Definition at line 136 of file RBMStructure.h.

References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
void shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::write ( OutArchive archive) const
inlinevirtual

Member Data Documentation

template<class HiddenType , class VisibleType , class VectorT , std::size_t hiddenFeatures, std::size_t visibleFeatures>
boost::array<MatrixType,hiddenFeatures * visibleFeatures> shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix
protected

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