:orphan: :mod:`torchfilter.base._kalman_filter_base` =========================================== .. py:module:: torchfilter.base._kalman_filter_base .. autoapi-nested-parse:: Private module; avoid importing from directly. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: torchfilter.base._kalman_filter_base.KalmanFilterBase .. py:class:: KalmanFilterBase(*, dynamics_model: DynamicsModel, measurement_model: KalmanFilterMeasurementModel, **unused_kwargs) Bases: :class:`torchfilter.base.Filter`, :class:`abc.ABC` .. autoapi-inheritance-diagram:: torchfilter.base._kalman_filter_base.KalmanFilterBase :parts: 1 Base class for a generic Kalman-style filter. Parameterizes beliefs with a mean and covariance. Subclasses should override ``_predict_step()`` and ``_update_step()``. .. attribute:: dynamics_model Forward model. :type: torchfilter.base.DynamicsModel .. attribute:: measurement_model Measurement model. :type: torchfilter.base.KalmanFilterMeasurementModel .. method:: forward(self, *, observations: types.ObservationsTorch, controls: types.ControlsTorch) -> types.StatesTorch Kalman filter forward pass, single timestep. :param observations: Observation inputs. Should be either a dict of tensors or tensor of shape ``(N, ...)``. :type observations: dict or torch.Tensor :param controls: Control inputs. Should be either a dict of tensors or tensor of shape ``(N, ...)``. :type controls: dict or torch.Tensor :returns: *torch.Tensor* -- Predicted state for each batch element. Shape should be ``(N, state_dim).`` .. method:: initialize_beliefs(self, *, mean: types.StatesTorch, covariance: types.CovarianceTorch) -> None Set filter belief to a given mean and covariance. :param mean: Mean of belief. Shape should be ``(N, state_dim)``. :type mean: torch.Tensor :param covariance: Covariance of belief. Shape should be ``(N, state_dim, state_dim)``. :type covariance: torch.Tensor .. method:: belief_mean(self) -> types.StatesTorch :property: Posterior mean. Shape should be ``(N, state_dim)``. .. method:: belief_covariance(self) -> types.CovarianceTorch :property: Posterior covariance. Shape should be ``(N, state_dim, state_dim)``.