otf.optim.gradient.adjoint
Classes:
| Name | Description |
|---|---|
AdjointGradient |
Compute parameter gradients using adjoint-based methods. |
UpdateOption |
Enum for selecting parameter update methods. |
AdjointGradient
AdjointGradient(
system: BaseSystem,
update_option: UpdateOption = UpdateOption.asymptotic,
solver: tuple[type[SinglestepSolver | MultistepSolver]]
| type[SinglestepSolver | MultistepSolver]
| None = None,
dt: float | None = None,
interval_fraction: float = 1,
)
Bases: GradientComputer
Compute parameter gradients using adjoint-based methods.
Supports different update strategies controlled by UpdateOption.
Initialize an AdjointGradient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
BaseSystem
|
|
required |
update_option
|
UpdateOption
|
Which adjoint/update method to use ( |
asymptotic
|
solver
|
tuple[type[SinglestepSolver | MultistepSolver]] | type[SinglestepSolver | MultistepSolver] | None
|
Solver class or tuple of solver classes used when simulation-based
adjoint computation is selected ( |
None
|
dt
|
float | None
|
Time-step used with the solver (required when |
None
|
interval_fraction
|
float
|
Fraction of the input time series to use for gradient computation (value in (0, 1]). |
1
|
Source code in src/otf/optim/gradient/adjoint.py
UpdateOption
Bases: Enum
Enum for selecting parameter update methods.
Options include:
- asymptotic: Uses the asymptotic approximation of the observed portion of the adjoint.
- complete: Uses the complete adjoint via simulation.
- unobserved: Uses the asymptotic approximation of the observed portion of the adjoint and simulates the unobserved portion.