simple iterative RBM implementation