GridNoiseMap#

class hybrid_aif.GridNoiseMap[source]#

Bases: NoiseMap

An observation noise that varies over the observed state: R_chol at the nodes of a rectangular grid over some of the state’s coordinates, read between nodes by multilinear interpolation (design: planning-with-observations.md D3).

values is (*grid_shape, d_obs, d_obs), a lower-triangular Cholesky factor with a positive diagonal at every node; interpolating such factors keeps both. axes names the state coordinates the grid spans, in order; low and high are the grid’s extent per axis, one number each, and a mean outside the extent reads the nearest edge. The map is differentiable in the mean almost everywhere, so the gradient planner sees it; a grid blurred before declaration gives it a smooth gradient. values, low and high are leaves and only axes is static, so a new grid or a new extent is a new params, never a new trace: a map in a frame that moves with the agent is resampled onto a fixed body-frame grid each step, the grid’s own axes staying aligned with the state’s. A point map: no prior and no learning.

A map over a modality’s categorical parents (an action node counts) carries one leading level axis per parent, in A_deps order: values is (*levels, *grid_shape, d_obs, d_obs), the leading axes being whatever values has beyond the grid and the factor (n_levels). A level is selected first (select()) and the grid read at the mean after, so a levelled map at one level is the plain map declared for that level. Called directly it returns every level’s factor, (*levels, *batch, d_obs, d_obs).

__init__(values, low, high, axes)[source]#
values: Array#

The Cholesky factor at every grid node, (*levels, *grid_shape, d_obs, d_obs): lower triangular with a positive diagonal (the leading level axes only on a levelled map).

axes: tuple[int, ...]#

The state coordinates the grid spans, in order (static).

low: Array#

The grid’s lower extent per axis, one number each.

high: Array#

The grid’s upper extent per axis, one number each.

property n_levels: int#

How many leading level axes values carries (zero for a plain map).

property levels: tuple[int, ...]#

The sizes of the leading level axes, in A_deps order of the parents.

select(levels)[source]#

The plain map at one level of each categorical parent: the leading level axes indexed at levels (integer scalars, traced or not), in order.