optiprofiler.FeaturedProblem.grad

optiprofiler.FeaturedProblem.grad#

FeaturedProblem.grad(x)[source]#

Evaluate the gradient of the objective function.

Parameters:
xarray_like, shape (n,)

Point at which to evaluate the gradient of the objective function.

Returns:
numpy.ndarray, shape (n,)

Gradient of the objective function at x.

Raises:
ValueError

If the argument x has an invalid shape or if the return value of the argument grad has an invalid shape.