implemented equations (7) and (8) from Hinton's paper in RBM, needs unit test