Inference using the trained RBM