|
| RBM (arma::Mat< ElemType > predictors, InitializationRuleType initializeRule, const size_t visibleSize, const size_t hiddenSize, const size_t batchSize=1, const size_t numSteps=1, const size_t negSteps=1, const size_t poolSize=2, const ElemType slabPenalty=8, const ElemType radius=1, const bool persistence=false) |
| Initialize all the parameters of the network using initializeRule. More...
|
|
double | Evaluate (const arma::Mat< ElemType > ¶meters, const size_t i, const size_t batchSize) |
| Evaluate the RBM network with the given parameters. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, double >::type | FreeEnergy (const arma::Mat< ElemType > &input) |
| This function calculates the free energy of the BinaryRBM. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, double >::type | FreeEnergy (const arma::Mat< ElemType > &input) |
| This function calculates the free energy of the SpikeSlabRBM. More...
|
|
void | Gibbs (const arma::Mat< ElemType > &input, arma::Mat< ElemType > &output, const size_t steps=SIZE_MAX) |
| This function does the k-step Gibbs Sampling. More...
|
|
void | Gradient (const arma::Mat< ElemType > ¶meters, const size_t i, arma::Mat< ElemType > &gradient, const size_t batchSize) |
| Calculates the gradients for the RBM network. More...
|
|
DataType & | HiddenBias () |
| Modify the hidden bias of the network. More...
|
|
DataType const & | HiddenBias () const |
| Return the hidden bias of the network. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, void >::type | HiddenMean (const InputType &input, DataType &output) |
| The function calculates the mean for the hidden layer. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | HiddenMean (const InputType &input, DataType &output) |
| The function calculates the mean of the Normal distribution of P(s|v, h). More...
|
|
size_t const & | HiddenSize () const |
| Get the hidden size. More...
|
|
size_t | NumFunctions () const |
| Return the number of separable functions (the number of predictor points). More...
|
|
size_t | NumSteps () const |
| Return the number of steps of Gibbs Sampling. More...
|
|
arma::Mat< ElemType > & | Parameters () |
| Modify the parameters of the network. More...
|
|
const arma::Mat< ElemType > & | Parameters () const |
| Return the parameters of the network. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, void >::type | Phase (const InputType &input, DataType &gradient) |
| Calculates the gradient of the RBM network on the provided input. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | Phase (const InputType &input, DataType &gradient) |
| Calculates the gradient of the RBM network on the provided input. More...
|
|
size_t const & | PoolSize () const |
| Get the pool size. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, void >::type | Reset () |
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | Reset () |
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, void >::type | SampleHidden (const arma::Mat< ElemType > &input, arma::Mat< ElemType > &output) |
| This function samples the hidden layer given the visible layer using Bernoulli function. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | SampleHidden (const arma::Mat< ElemType > &input, arma::Mat< ElemType > &output) |
| This function samples the slab outputs from the Normal distribution with mean given by: and variance: . More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | SampleSlab (InputType &slabMean, DataType &slab) |
| The function samples from the Normal distribution of P(s|v, h), where the mean is given by: and variance is given by: . More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | SampleSpike (InputType &spikeMean, DataType &spike) |
| The function samples the spike function using Bernoulli distribution. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, void >::type | SampleVisible (arma::Mat< ElemType > &input, arma::Mat< ElemType > &output) |
| This function samples the visible layer given the hidden layer using Bernoulli function. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | SampleVisible (arma::Mat< ElemType > &input, arma::Mat< ElemType > &output) |
| Sample Hidden function samples the slab outputs from the Normal distribution with mean given by: and variance: . More...
|
|
template<typename Archive > |
void | serialize (Archive &ar, const unsigned int) |
| Serialize the model. More...
|
|
void | Shuffle () |
| Shuffle the order of function visitation. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | SlabMean (const DataType &visible, DataType &spike, DataType &slabMean) |
| The function calculates the mean of Normal distribution of P(s|v, h), where the mean is given by: . More...
|
|
ElemType const & | SlabPenalty () const |
| Get the regularizer associated with slab variables. More...
|
|
DataType & | SpikeBias () |
| Modify the regularizer associated with spike variables. More...
|
|
DataType const & | SpikeBias () const |
| Get the regularizer associated with spike variables. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | SpikeMean (const InputType &visible, DataType &spikeMean) |
| The function calculates the mean of the distribution P(h|v), where mean is given by: . More...
|
|
template<typename OptimizerType , typename... CallbackType> |
double | Train (OptimizerType &optimizer, CallbackType &&... callbacks) |
| Train the RBM on the given input data. More...
|
|
DataType & | VisibleBias () |
| Modify the visible bias of the network. More...
|
|
DataType const & | VisibleBias () const |
| Return the visible bias of the network. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, BinaryRBM >::value, void >::type | VisibleMean (InputType &input, DataType &output) |
| The function calculates the mean for the visible layer. More...
|
|
template<typename Policy = PolicyType, typename InputType = DataType> |
std::enable_if< std::is_same< Policy, SpikeSlabRBM >::value, void >::type | VisibleMean (InputType &input, DataType &output) |
| The function calculates the mean of the Normal distribution of P(v|s, h). More...
|
|
DataType & | VisiblePenalty () |
| Modify the regularizer associated with visible variables. More...
|
|
DataType const & | VisiblePenalty () const |
| Get the regularizer associated with visible variables. More...
|
|
size_t const & | VisibleSize () const |
| Get the visible size. More...
|
|
arma::Cube< ElemType > & | Weight () |
| Modify the weights of the network. More...
|
|
arma::Cube< ElemType > const & | Weight () const |
| Get the weights of the network. More...
|
|
template<typename InitializationRuleType, typename DataType = arma::mat, typename PolicyType = BinaryRBM>
class mlpack::ann::RBM< InitializationRuleType, DataType, PolicyType >
The implementation of the RBM module.
A Restricted Boltzmann Machines (RBM) is a generative stochastic artificial neural network that can learn a probability distribution over its set of inputs. RBMs have found applications in dimensionality reduction, classification, collaborative filtering, feature learning and topic modelling. They can be trained in either supervised or unsupervised ways, depending on the task. They are a variant of Boltzmann machines, with the restriction that the neurons must form a bipartite graph.
- Template Parameters
-
InitializationRuleType | Rule used to initialize the network. |
DataType | The type of matrix to be used. |
PolicyType | The RBM variant to be used (BinaryRBM or SpikeSlabRBM). |
Definition at line 38 of file rbm.hpp.