symforce.opt.objectives.norm_barrier_objective module#

class NormBarrierObjective[source]#

Bases: TimestepObjective

class Params(norm_nominal, error_nominal, dist_zero_to_nominal)[source]#

Bases: object

Parameters:
  • norm_nominal (float) –

  • error_nominal (float) –

  • dist_zero_to_nominal (float) –

norm_nominal#

Value of the norm at which the error is equal to error_nominal.

Type:

float

error_nominal#

Error returned when the norm is equal to norm_nominal.

Type:

float

dist_zero_to_nominal#

The distance from norm_nominal to the region of zero error. Must be a positive number.

Type:

float

norm_nominal: float#
error_nominal: float#
dist_zero_to_nominal: float#
class ExtraValues(unwhitened_residual)[source]#

Bases: object

Parameters:

unwhitened_residual (Matrix11) –

unwhitened_residual#

Error after applying the barrier function but before applying the cost scaling.

Type:

symforce.geo.matrix.Matrix11

unwhitened_residual: Matrix11#
static residual_at_timestep(vector, params, epsilon, cost_scaling=1, power=1)[source]#

Returns the residual block for the given timestep, where the residual is computed by applying a max barrier function to the norm of the given vector, and then optionally scaling the corresponding cost in the overall optimization problem by cost_scaling.

Parameters:
  • vector (Matrix) – Vector whose norm we wish to apply a barrier to.

  • params (Params) – Parameters defining the barrier function.

  • power (float) – Power of the barrier function. Defaults to 1, producing a linear barrier function in the residual, which corresponds to a quadratic cost in the overall optimization problem.

  • cost_scaling (float) – Optional scaling parameter. Corresponds to multiplying the cost in the overall optimization problem by a constant.

  • epsilon (float) –

Return type:

ResidualBlock