Learn R Programming

darch (version 0.12.0)

trainRBM: Trains an '>RBM with contrastive divergence

Description

The function trains a restricted Boltzmann machine ('>RBM) with the contrastive divergence method.

Usage

trainRBM(rbm, trainData, numEpochs = 1, numCD = 1, shuffleTrainData = T,
  ...)

Arguments

rbm

A instance of the class '>RBM.

trainData

The data matrix for the training

numEpochs

The number of training iterations

numCD

Number of contrastive divergence iterations

shuffleTrainData

Whether to shuffle the training data prior to each epoch.

...

Additional parameters for the unit functions

Details

This function is build on the basis of the code from G. Hinton et. al. (http://www.cs.toronto.edu/~hinton/MatlabForSciencePaper.html - last visit 2016-04-30) for the pre training of deep belief nets. The original code is located in the files 'rbm.m' and 'rbmhidlinear.m'. It iterates in every epoche over the batches and calculates the updates for the weights. If it is the first CD iteration or the CD iterations are finished, the hidden units are calculated with the real value activations of the visible units, otherwise with the binary activations. To tell the unit functions the actual state of the training, the function generates a array with the following running parameters and passes them to the units: Number of epochs: "numEpochs", current epochs: "currentEpoch", Number of batches: "numBatches", current batch: "currentBatch", Maximal CD iterations: "numCD", current CD iteration: "currentCD", CD is finished: "finishCD".

See Also

'>RBM