Trajectory (Path) OED Criteria#

OED criteria designed for trajectory (path) experimental design where the design is defined as a discrete path on a navigation mesh predefined by the user. Multiple optimality criteria are developed for experimental purposes, and the functionality will likely change to be more general. The implementations here, however, provide the guidelines for future expansions

This module provides implementations of utility functions valid for trajectory OED Eventually, this can be moved into the OED subpackage under utility_functions

class TrajectoryUtilityFunctionConfigs(*, debug=False, verbose=False, output_dir='./_PYOED_RESULTS_', inverse_problem=None, criterion='a_optimal', sensor_size=1, navigation_grid=None)[source]#

Bases: CriterionConfigs

Configuration class for TrajectoryUtilityFunction.

Parameters:
  • verbose (bool) – a boolean flag to control verbosity of the object.

  • debug (bool) – a boolean flag that enables adding extra functionality in a debug mode

  • output_dir (str | Path) – the base directory where the output files will be saved.

  • inverse_problem (Smoother | None) – an instance of an inverse problem Smoother.

  • criterion (str) – name of the OED criterion to use as the objective (utility) function.

  • sensor_size (int) – number of sensors to use/activate around the trajectory state in order to build the observation operator.

  • navigation_grid (ndarray | None) – the navigation grid. This could be the same as the observation operator (if None) (base) grid that defines all candidate locations. The navigation grid, however could be different from the observation grid, thus it must be passed here.

inverse_problem: Smoother | None#
criterion: str#
sensor_size: int#
navigation_grid: ndarray | None#
__init__(*, debug=False, verbose=False, output_dir='./_PYOED_RESULTS_', inverse_problem=None, criterion='a_optimal', sensor_size=1, navigation_grid=None)#
class TrajectoryUtilityFunction(configs=None)[source]#

Bases: Criterion

A utility function for trajectory OED problems.

__init__(configs=None)[source]#
validate_configurations(configs, raise_for_invalid=True)[source]#

Validate the passed configurations object.

Parameters:

configs (dict | TrajectoryUtilityFunctionConfigs) – configurations to validate. If a TrajectoryUtilityFunctionConfigs object is passed, validation is performed on the entire set of configurations. However, if a dictionary is passed, validation is performed only on the configurations corresponding to the keys in the dictionary.

Raises:

PyOEDConfigsValidationError – if the configurations are invalid and raise_for_invalid is set to True.

update_configurations(**kwargs)[source]#

Take any set of keyword arguments, and lookup each in the configurations, and update as nessesary/possible/valid

Raises:

PyOEDConfigsValidationError – if invalid configurations passed

evaluate(trajectory)[source]#

Evaluate the utility function / optimality criterion at the given design (trajectory).

get_time_dependent_design(trajectory)[source]#

Convert a trajectory (of indexes) into time-dependent design (dict)

get_observation_targets(center)[source]#

Get the observation target locations based on the agent state (center sensor location) stated as (x, y) coordinates. This is a methos to determine observation targets (gridpoints given the center of a batch of sensors)

Returns:

(idx_closest, targets) where: - ‘idx_closest’: indexes (in the observation grid) of coordinates to choose - ‘targets’: the actual targets

posterior_covariance(trajectory, precond=False)[source]#

Evaluate the posterior covariance matrix (in full)

FIM_inv(trajectory, data_misfit_only=True, precond=False)[source]#
FIM(trajectory, data_misfit_only=True, precond=False)[source]#

Construct the FIM (Hessian of 4dvar without prior) in full for a given trajectory

property navigation_grid#
property inverse_problem#
property criterion#
property sensor_size#
property prior_covariance_sqrt_T#

Lazy sqrt of the prior covariance matrix (compute once)

property prior_precision#

Lazy inverse of the prior covariance matrix (compute once)

property frozen_model#

Reference to the lazy object self._FROZEN_MODEL If this is Called, the object is constructed if not available. The returned object is actually a dictionary of numpy array representation of the simulation model over registered observaiton times.

property linearization_point#

Reference to the lazy object self._LINEARIZATION_POINT. If this is Called, the object is constructed if not available. The returned object is either None (if the underlying inverse problem is linear) or the solution of the inverse problem (of the inference parameter) to be used as linearization point of the model, operators, etc in the case of nonlinear inference.

property randomization_vectors#

Reference to the lazy object self._RANDOMIZATION_VECTORS If this is Called, the object is constructed if not available. The returned object is actually a list of random vectors used to estimate the requested criterion.

property frozen_goal_operator#

If the inverse problem provides goal_operator, construct it as a matrix, otherwise None

property frozen_goal_operator_adjoint#

If the inverse problem provides goal_operator, construct it as a matrix, otherwise None

TrajectoryCriterionConfigs#

alias of TrajectoryUtilityFunctionConfigs

TrajectoryCriterion#

alias of TrajectoryUtilityFunction