I want to use scipy.optimize.check_grad
to evaluate correctness of gradients. I specify
def func(x, a):
return x[0]**2 - 0.5 * x[1]**3 + a**2
def grad(x, a):
return [2 * x[0], -1.5 * x[1]**2 + 2*a]
from scipy.optimize import check_grad
a = 5
check_grad(func, grad, [1.5, -1.5], args = (a))
And get error
Unknown keyword arguments: ['args']
Noteworthy args is listed as an argumet in the help file. Shouldn't this work?