amici.gradient_check
Finite Difference Check
This module provides functions to automatically check correctness of amici computed sensitivities using finite difference approximations
Functions
|
Finite differences check for likelihood gradient. |
|
Checks the computed sensitivity based derivatives against a finite difference approximation. |
- amici.gradient_check.check_derivatives(model, solver, edata=None, atol=0.0001, rtol=0.0001, epsilon=0.001, check_least_squares=True, skip_zero_pars=False)[source]
Finite differences check for likelihood gradient.
- Parameters:
model (
amici.amici.Model
) – amici modelsolver (
amici.amici.Solver
) – amici solveredata (
amici.amici.ExpData
|None
) – exp datacheck_least_squares (
bool
) – whether to check least squares related values.skip_zero_pars (
bool
) – whether to perform FD checks for parameters that are zero
- Return type:
- amici.gradient_check.check_finite_difference(x0, model, solver, edata, ip, fields, atol=0.0001, rtol=0.0001, epsilon=0.001)[source]
Checks the computed sensitivity based derivatives against a finite difference approximation.
- Parameters:
x0 (
collections.abc.Sequence
[float
]) – parameter value at which to check finite difference approximationmodel (
amici.amici.Model
) – amici modelsolver (
amici.amici.Solver
) – amici solveredata (
amici.amici.ExpData
) – exp dataip (
int
) – parameter indexfields (
list
[str
]) – rdata fields for which to check the gradient
- Return type: