RBM train refactor
RBM train refactor