On approximating $\nabla f$ with neural networks