### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Optimization and root finding (`scipy.optimize`) »

# scipy.optimize.check_grad

`scipy.optimize.``check_grad`(func, grad, x0, *args)

  Check the correctness of a gradient function by comparing it against a (forward) finite-difference approximation of the gradient.

  Parameters : | func : callable func(x0,*args) Function whose derivative is to be checked. grad : callable grad(x0, *args) Gradient of func. x0 : ndarray Points to check grad against forward difference approximation of grad using func. args : *args, optional Extra arguments passed to func and grad.
  Returns : | err : float The square root of the sum of squares (i.e. the 2-norm) of the difference between `grad(x0, *args)` and the finite difference approximation of grad using func at the points x0.

  See also

  `approx_fprime`

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Optimization and root finding (`scipy.optimize`) »