torchfilter.data._particle_filter_measurement_dataset

Private module; avoid importing from directly.

Module Contents

Classes

ParticleFilterMeasurementDataset

A dataset interface for pre-training particle filter measurement models.

class torchfilter.data._particle_filter_measurement_dataset.ParticleFilterMeasurementDataset(trajectories: List[types.TrajectoryNumpy], *, covariance: np.ndarray, samples_per_pair: int, **kwargs)[source]

Bases: torch.utils.data.Dataset

Inheritance diagram of torchfilter.data._particle_filter_measurement_dataset.ParticleFilterMeasurementDataset

A dataset interface for pre-training particle filter measurement models.

Centers Gaussian distributions around our ground-truth states, and provides examples for learning the log-likelihood.

Parameters:

trajectories (List[torchfilter.types.TrajectoryNumpy]) – List of trajectories.

Keyword Arguments:
  • covariance (np.ndarray) – Covariance of Gaussian PDFs.

  • samples_per_pair (int) – Number of training examples to provide for each state/observation pair. Half of these will typically be generated close to the example, and the other half far away.

__getitem__(self, index) Tuple[types.StatesNumpy, types.ObservationsNumpy, np.ndarray][source]

Get a state/observation/log-likelihood sample from our dataset. Nominally, we want our measurement model to predict the returned log-likelihood as the PDF of the p(observation | state) distribution.

Parameters:

index (int) – Subsequence number in our dataset.

Returns:

tuple(state, observation, log-likelihood) tuple.

__len__(self) int[source]

Total number of samples in the dataset.

Returns:

int – Length of dataset.