If x is a global optimum for f, then grad(f, x)=0. I use this to test; it doesn’t require the implementation of f.
If x is a global optimum for f, then grad(f, x)=0. I use this to test; it doesn’t require the implementation of f.