changed RBM's trainTilConvergence to allow the variable params to be passed through to optimizer