:orphan: :mod:`torchfilter.data._single_step_dataset` ============================================ .. py:module:: torchfilter.data._single_step_dataset .. autoapi-nested-parse:: Private module; avoid importing from directly. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: torchfilter.data._single_step_dataset.SingleStepDataset .. py:class:: SingleStepDataset(trajectories: List[types.TrajectoryNumpy]) Bases: :class:`torch.utils.data.Dataset` .. autoapi-inheritance-diagram:: torchfilter.data._single_step_dataset.SingleStepDataset :parts: 1 A dataset interface that returns single-step training examples: ``(previous_state, state, observation, control)`` By default, extracts these examples from a list of trajectories. :param trajectories: List of trajectories. :type trajectories: List[torchfilter.types.TrajectoryNumpy] .. method:: __getitem__(self, index: int) -> Tuple[types.StatesNumpy, types.StatesNumpy, types.ObservationsNumpy, types.ControlsNumpy] Get a single-step prediction sample from our dataset. :param index: Subsequence number in our dataset. :type index: int :returns: *tuple* -- ``(previous_state, state, observation, control)`` tuple that contains data for a single subsequence. Each tuple member should be either a numpy array or dict of numpy arrays with shape ``(subsequence_length, ...)``. .. method:: __len__(self) -> int Total number of subsequences in the dataset. :returns: *int* -- Length of dataset.