Skip to content

opto.trainer.loader

DataLoader

DataLoader(
    dataset,
    batch_size=1,
    randomize=True,
    replacement=False,
    shuffle=True,
)

Initialize the data loader

Args: dataset: the dataset to load (a dict of inputs and infos) batch_size: the number of samples to load in each batch randomize: whether to randomize the dataset ordering before loading; if False, the dataset will be loaded in the order it is provided (replacement and shuffle be ignored) replacement: whether to sample with replacement shuffle: whether to shuffle the dataset after each epoch

dataset instance-attribute

dataset = dataset

batch_size instance-attribute

batch_size = batch_size

randomize instance-attribute

randomize = randomize

replacement instance-attribute

replacement = replacement

shuffle instance-attribute

shuffle = shuffle

n_epochs instance-attribute

n_epochs = 0

sample

sample()

Sample a batch of data from the dataset

save

save(path)

Save the dataset to a file.

load

load(path)

Load the dataset from a file.