RBM
with contrastive divergenceThe function trains a restricted Boltzmann machine (RBM
) with
the contrastive divergence method.
trainRBM(rbm, trainData, numEpochs = 1, numCD = 1, ...)
A instance of the class RBM
.
The data matrix for the training
The number of training iterations
Number of contrastive divergence iterations
Additional parameters for the unit functions
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 06.06.2013) 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 source code from sigmUnitFuncSwitch
for an example).