synthetic_hparams#

Synthetic Dataset hyperparameter mixin.

Hparams

These classes are used with yahp for YAML-based configuration.

SyntheticHparamsMixin

Synthetic dataset parameter mixin for DatasetHparams.

class composer.datasets.synthetic_hparams.SyntheticHparamsMixin(use_synthetic=False, synthetic_num_unique_samples=100, synthetic_device='cpu', synthetic_memory_format=MemoryFormat.CONTIGUOUS_FORMAT)[source]#

Bases: yahp.hparams.Hparams, abc.ABC

Synthetic dataset parameter mixin for DatasetHparams.

If a dataset supports yielding synthetic data, it should implement this mixin.

Parameters
  • use_synthetic (bool, optional) โ€“ Whether to use synthetic data. Default: False.

  • synthetic_num_unique_samples (int, optional) โ€“ The number of unique samples to allocate memory for. Ignored if use_synthetic is False. Default: 100.

  • synthetic_device (str, optional) โ€“ The device to store the sample pool on. Set to 'cuda' to store samples on the GPU and eliminate PCI-e bandwidth with the dataloader. Set to 'cpu' to move data between host memory and the device on every batch. Ignored if use_synthetic is False. Default: 'cpu'.

  • synthetic_memory_format โ€“ The MemoryFormat to use. Ignored if use_synthetic is False. Default: 'CONTIGUOUS_FORMAT'.