symforce.opt.objective module#
- class Objective[source]#
Bases:
ABC
An objective, defined as a residual or group of residuals and an associated Params block
Subclasses should add individual residual functions as static methods that return
residual_block.ResidualBlock
, and define the Params block as a dataclass
- class TimestepObjective[source]#
Bases:
Objective
An objective defined as a single residual applied over multiple timesteps, and associated Params block
Subclasses should define the
residual_at_timestep()
function needed to compute the residual at each timestep.- abstract residual_at_timestep(*args)[source]#
Compute the residual at a single timestep
- Parameters:
* – Any arguments needed for the particular residual; typically these are expressions evaluated at a particular time, or single element of a timestepped sequence
args (Any) –
- Returns:
residual_block – The ResidualBlock for this objective at this timestep
- Return type: