added some details to getgradient in RBM