update rbm algorithm