vp_suite.datasets.mmnist_on_the_fly

class MovingMNISTOnTheFly(split, **dataset_kwargs)

Bases: vp_suite.base.base_dataset.VPDataset

Dataset class for the dataset “Moving MNIST”, as firstly encountered in “Unsupervised Learning of Video Representations using LSTMs” by Srivastava et al. (https://arxiv.org/pdf/1502.04681v3.pdf).

Each sequence depicts two digits from the MNIST dataset moving linearly in front of a black background, occasionally bouncing off the wall and overlapping each other.

As opposed to the other Moving MNIST dataset, this one generates the digit sequences on-the-fly, randomly sampling digits and velocities. Besides the digit templates, no data is downloaded.

ACTION_SIZE: int = 0

The size of the action vector per frame (If the dataset provides no actions, this value is 0).

DATASET_FRAME_SHAPE: (<class 'int'>, <class 'int'>, <class 'int'>) = (64, 64, 3)

Shape of a single frame in the dataset (height, width, channels).

DEFAULT_DATA_DIR: pathlib.Path = PosixPath('/home/runner/work/vp-suite/vp-suite/vp-suite-data/data/moving_mnist_on_the_fly')

The default save location of the dataset files.

DEFAULT_N_SEQS = {'test': 1000, 'train': 9600, 'val': 400}

Default values for the dataset split sizes.

IS_DOWNLOADABLE: str = 'Yes (MNIST digits)'

A string identifying whether the dataset can be (freely) downloaded.

MIN_SEQ_LEN: int = 100000000.0

Sequence length unbounded, depends on input sequence length

NAME: str = 'Moving MNIST - On the fly'

The dataset’s name.

ON_THE_FLY: bool = True

If true, accessing the dataset means data is generated on the fly rather than fetched from storage.

SPLIT_SEED_OFFSETS = {'test': <function MovingMNISTOnTheFly.<lambda>>, 'train': <function MovingMNISTOnTheFly.<lambda>>, 'val': <function MovingMNISTOnTheFly.<lambda>>}

passing the seed value to these functions guarantees unique RNG for all splits

VALID_SPLITS = ['train', 'val', 'test']

The valid arguments for specifying splits.

__init__(split, **dataset_kwargs)

Initializes the dataset loader by determining its split and extracting and processing all dataset attributes from the parameters given in dataset_kwargs.

Parameters
  • split (str) – The dataset’s split identifier (i.e. whether it’s a training/validation/test dataset)

  • **dataset_kwargs (Any) – Optional dataset arguments for image transformation, value_range, splitting etc.

download_and_prepare_dataset()

Downloads the MNIST digit data so that on-the-fly generation can take place.

max_acc = 0
max_speed = 5
min_acc = 0
min_speed = 2
n_seqs = None
num_channels = 3
num_digits = 2
reset_rng()

Creates RNG-based generation helpers for the on-the-fly generation, re-setting the RNG.

rng_seed = 4115