uqtils.gradient
Module for vectorized finite-difference gradient approximations.
Includes:
approx_jac
- vectorized Jacobian approximationapprox_hess
- vectorized Hessian approximation
approx_hess(func, theta, pert=0.01)
Approximate Hessian of func
at a specified theta
location using finite difference approximation.
PARAMETER | DESCRIPTION |
---|---|
func
|
expects to be called as
|
theta
|
TYPE:
|
pert
|
perturbation percent for approximate partial derivatives
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
ndarray
|
|
Source code in src/uqtils/gradient.py
approx_jac(func, theta, pert=0.01)
Approximate Jacobian of func
at a specified theta
location using finite difference approximation.
PARAMETER | DESCRIPTION |
---|---|
func
|
expects to be called as
|
theta
|
TYPE:
|
pert
|
perturbation percent for approximate partial derivatives
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
ndarray
|
|