cpp and python version of DBN and RBM.