MATLAB class for RBM