ncalab.data
Submodules
Classes
An abstract class representing a |
Package Contents
- class ncalab.data.GrowingNCADataset(image: numpy.ndarray, num_channels: int, batch_size: int = 8)
Bases:
torch.utils.data.DatasetAn abstract class representing a
Dataset.All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite
__getitem__(), supporting fetching a data sample for a given key. Subclasses could also optionally overwrite__len__(), which is expected to return the size of the dataset by manySamplerimplementations and the default options ofDataLoader. Subclasses could also optionally implement__getitems__(), for speedup batched samples loading. This method accepts list of indices of samples of batch and returns list of samples.Note
DataLoaderby default constructs an index sampler that yields integral indices. To make it work with a map-style dataset with non-integral indices/keys, a custom sampler must be provided.Dedicated dataset for “growing” tasks, like growing emoji.
The idea is to train a model solely for the purpose to generate (“grow”) a fixed image. Hence, this Dataset class only stores multiple copies of the same image.
- Parameters:
[np.ndarray] (image) – Input image.
[int] (batch_size) – Total number of image channels (including hidden)
[int] – Output batch size. Defaults to 8.
- batch_size = 8
- image
- seed
- __len__()
- __getitem__(idx)