Gradient Estimation for Attractor Networks