A CUDA implementation of a restricted Boltzmann machine (RBM) with the Contrastive Divergence learning algorithm.
In order to test the implementation just type make
in your command line. The first time you do this the MNIST handwritten digits dataset will be download. The dataset is used to train RBM. You can print sample MNIST digits to the console (using ASCII art) by typing make print
.
The implementation demonstrates cuBLAS, cuRAND and Thrust libraries. It was tested with CUDA version 7.5 on Nvidia Tesla M2090 and K40 GPUs.
Please bear in mind that this is a simplified implementation. To make it more applicable some optimizations should be undertaken. For example stochastic gradient descent (or its mini-batch version) should be used instead of batch gradient descent. Other optimization would be to reuse memory buffers among epochs instead of reallocating them within each step.