rbm gradient calculation done