Use finite differences to compute gradients.