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... | |
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.
| typedef VectorMatrixTraits<VectorType>::MatrixType shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::MatrixType |
Definition at line 44 of file RBMStructure.h.
| typedef VectorT shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::VectorType |
Definition at line 43 of file RBMStructure.h.
|
inlinevirtual |
Configures the network.
two properties must be avaiable: numberOfHN :number of hidden neurons numberOfVN :number of visible neurons
Reimplemented from shark::IConfigurable.
Definition at line 80 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfHN(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfVN(), and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setStructure().
|
inline |
Returns the layer of hidden neurons.
Definition at line 151 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons.
|
inline |
Returns the layer of hidden neurons.
Definition at line 156 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons.
|
inline |
Returns the number of phi-functions of the hidden neuron layer.
Definition at line 141 of file RBMStructure.h.
|
inline |
Returns the number of hidden neurons.
Definition at line 171 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons.
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::configure(), and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfParameters().
|
inlinevirtual |
Returns the total number of parameters of the model.
Reimplemented from shark::IParameterizable.
Definition at line 88 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfHN(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfVN(), and shark::parameters().
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::parameterVector().
|
inline |
Returns the number of phi-functions of the hidden neuron layer.
Definition at line 146 of file RBMStructure.h.
|
inline |
Returns the number of visible neurons.
Definition at line 176 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons.
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::configure(), and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfParameters().
|
inlinevirtual |
Returns the parameters of the RBM as ParameterVector.
Reimplemented from shark::IParameterizable.
Definition at line 96 of file RBMStructure.h.
References shark::init(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix, shark::matrixSet(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfParameters(), and shark::parameters().
|
inlinevirtual |
Reads the network from an archive.
Reimplemented from shark::ISerializable.
Definition at line 60 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons, and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.
|
inlinevirtual |
Sets the parameters of the RBM.
Reimplemented from shark::IParameterizable.
Definition at line 104 of file RBMStructure.h.
References shark::init(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix, shark::matrixSet(), and shark::parameters().
|
inline |
Creates an RBM with a specified number of visible and hidden units.
| numOfVN | number of visible units |
| numOfHN | number of hidden units |
Definition at line 112 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons, and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::configure().
|
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.
|
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.
|
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.
| i | index of the hidden phi-function |
| j | index of the visible phi-function |
Definition at line 127 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.
|
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.
| i | index of the hidden phi-function |
| j | index of the visible phi-function |
Definition at line 136 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.
|
inlinevirtual |
Writes the network to an archive.
Reimplemented from shark::ISerializable.
Definition at line 68 of file RBMStructure.h.
References shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_hiddenNeurons, shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_visibleNeurons, and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::m_weightMatrix.
|
protected |
The layer of hidden Neurons.
Definition at line 52 of file RBMStructure.h.
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::hiddenNeurons(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfHN(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfParameters(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::parameterVector(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::read(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setParameterVector(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setStructure(), and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::write().
|
protected |
The Layer of visible Neurons.
Definition at line 55 of file RBMStructure.h.
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfParameters(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::numberOfVN(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::parameterVector(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::read(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setParameterVector(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setStructure(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::visibleNeurons(), and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::write().
|
protected |
Matrices that identify the weights associated with the connections between the visible and the hidden neurons (In the standard case just one single matrix)
Definition at line 49 of file RBMStructure.h.
Referenced by shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::parameterVector(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::read(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setParameterVector(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::setStructure(), shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::weightMatrix(), and shark::RBMStructure< HiddenType, VisibleType, VectorT, hiddenFeatures, visibleFeatures >::write().