tinker_cookbook.supervised.SupervisedDataset
class tinker_cookbook.supervised.SupervisedDataset()
Abstract base for datasets used in supervised learning.
Subclasses must implement get_batch and __len__. set_epoch
may be overridden to shuffle data between epochs.
get_batch(index)
Return a batch of training Datum objects at the given index.
Parameters:
- index (int) – The batch index.
Returns: list[tinker.Datum] – The training datums for this batch.
set_epoch(seed)
Notify the dataset that a new epoch is starting.
Implementations may use this to reshuffle data. The default emits a warning that shuffling is not implemented.
Parameters:
- seed (int) – Epoch seed that can be used for deterministic shuffling. Default
0.