mrf$grad is just sigmoidGrad