nncore.dataset

Wrapper

class nncore.dataset.wrapper.RepeatDataset(*args: Any, **kwargs: Any)[source]

A dataset wrapper for repeated samples.

The length of repeated dataset will be times larger than the original dataset. This is useful when the data loading time is long but the dataset is small. Using this class can reduce the data loading time among epochs.

Parameters:
  • dataset (Dataset | cfg | str) – The dataset or config of dataset to be repeated.

  • times (int) – The number of repeat times.

Builder

nncore.dataset.builder.build_dataset(cfg, *args, **kwargs)[source]

Build a dataset from a dict. This method searches for datasets in DATASETS first, and then fall back to torch.utils.data.dataset.

Parameters:

cfg (dict) – The config of the dataset.

Returns:

The constructed dataset.

Return type:

nn.Module