otf.optim.gradient.sensitivity
Classes:
| Name | Description |
|---|---|
SensitivityGradient |
Compute gradients using sensitivity (forward) equations. |
UpdateOption |
Enum for selecting parameter update methods. |
SensitivityGradient
SensitivityGradient(
system: BaseSystem,
update_option: UpdateOption = UpdateOption.last_state,
solver: tuple[type[SinglestepSolver | MultistepSolver]]
| type[SinglestepSolver | MultistepSolver]
| None = None,
dt: float | None = None,
use_unobserved_asymptotics: bool = False,
)
Bases: GradientComputer
Compute gradients using sensitivity (forward) equations.
Different UpdateOptions select how the sensitivity information is
assembled (last state, mean state, mean gradient, or complete simulation).
Initialize a SensitivityGradient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
BaseSystem
|
|
required |
update_option
|
UpdateOption
|
Strategy for forming the gradient ( |
last_state
|
solver
|
tuple[type[SinglestepSolver | MultistepSolver]] | type[SinglestepSolver | MultistepSolver] | None
|
Solver class or tuple of solver classes used when the |
None
|
dt
|
float | None
|
Time-step used with the solver (required when |
None
|
use_unobserved_asymptotics
|
bool
|
When True attempt to use asymptotic information from unobserved state components (experimental). |
False
|
Source code in src/otf/optim/gradient/sensitivity.py
UpdateOption
Bases: Enum
Enum for selecting parameter update methods.
Options include:
- last_state: Uses the last observed state for the update and the asymptotic approximation for the observed portion of the sensitivity.
- mean_state: Uses the mean of the observed states for the update and the asymptotic approximation for the observed portion of the sensitivity.
- mean_gradient: Uses the mean of the gradients for the update and the asymptotic approximation for the observed portion of the sensitivity.
- complete: Uses the mean of the gradients for the update and the complete sensitivity via simulation.