ncalab.data.growingncadataset ============================= .. py:module:: ncalab.data.growingncadataset Classes ------- .. autoapisummary:: ncalab.data.growingncadataset.GrowingNCADataset Module Contents --------------- .. py:class:: GrowingNCADataset(image: numpy.ndarray, num_channels: int, batch_size: int = 8) Bases: :py:obj:`torch.utils.data.Dataset` An abstract class representing a :class:`Dataset`. All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite :meth:`__getitem__`, supporting fetching a data sample for a given key. Subclasses could also optionally overwrite :meth:`__len__`, which is expected to return the size of the dataset by many :class:`~torch.utils.data.Sampler` implementations and the default options of :class:`~torch.utils.data.DataLoader`. Subclasses could also optionally implement :meth:`__getitems__`, for speedup batched samples loading. This method accepts list of indices of samples of batch and returns list of samples. .. note:: :class:`~torch.utils.data.DataLoader` by 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. :param image [np.ndarray]: Input image. :param num_channels [int]: Total number of image channels (including hidden) :param batch_size [int]: Output batch size. Defaults to 8. .. py:attribute:: batch_size :value: 8 .. py:attribute:: image .. py:attribute:: seed .. py:method:: __len__() .. py:method:: __getitem__(idx)