:orphan: :mod:`torchfilter.base._particle_filter_measurement_model` ========================================================== .. py:module:: torchfilter.base._particle_filter_measurement_model .. autoapi-nested-parse:: Private module; avoid importing from directly. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: torchfilter.base._particle_filter_measurement_model.ParticleFilterMeasurementModel torchfilter.base._particle_filter_measurement_model.ParticleFilterMeasurementModelWrapper .. py:class:: ParticleFilterMeasurementModel(state_dim: int) Bases: :class:`abc.ABC`, :class:`torch.nn.Module` .. autoapi-inheritance-diagram:: torchfilter.base._particle_filter_measurement_model.ParticleFilterMeasurementModel :parts: 1 Observation model base class for a generic differentiable particle filter; maps (state, observation) pairs to the log-likelihood of the observation given the state ( $\log p(z | x)$ ). .. attribute:: state_dim Dimensionality of our state. :type: int .. method:: forward(self, *, states: types.StatesTorch, observations: types.ObservationsTorch) -> torch.Tensor :abstractmethod: Observation model forward pass, over batch size ``N``. For each member of a batch, we expect ``M`` separate states (particles) and one unique observation. :param states: States to pass to our observation model. Shape should be ``(N, M, state_dim)``. :type states: torch.Tensor :param observations: Measurement inputs. Should be either a dict of tensors or tensor of size ``(N, ...)``. :type observations: dict or torch.Tensor :returns: *torch.Tensor* -- Log-likelihoods of each state, conditioned on a corresponding observation. Shape should be ``(N, M)``. .. py:class:: ParticleFilterMeasurementModelWrapper(kalman_filter_measurement_model: KalmanFilterMeasurementModel) Bases: :class:`torchfilter.base.ParticleFilterMeasurementModel` .. autoapi-inheritance-diagram:: torchfilter.base._particle_filter_measurement_model.ParticleFilterMeasurementModelWrapper :parts: 1 Helper class for creating a particle filter measurement model (states, observations -> log-likelihoods) from a Kalman filter one (states -> observations). :param kalman_filter_measurement_model: Kalman filter measurement model instance to wrap. :type kalman_filter_measurement_model: torchfilter.base.KalmanFilterMeasurementModel .. method:: forward(self, *, states: types.StatesTorch, observations: types.ObservationsTorch) -> torch.Tensor Observation model forward pass, over batch size ``N``. For each member of a batch, we expect ``M`` separate states (particles) and one unique observation. :param states: States to pass to our observation model. Shape should be ``(N, M, state_dim)``. :type states: torch.Tensor :param observations: Measurement inputs. Should be either a dict of tensors or tensor of size ``(N, ...)``. :type observations: torch.Tensor :returns: *torch.Tensor* -- Log-likelihoods of each state, conditioned on a corresponding observation. Shape should be ``(N, M)``.