Python API Reference

aeon.DataLoader Encapsulates the data loader library and exposes an API to iterate over generic data (images, video or audio given in compressed form).
class aeon.DataLoader(config, backend)[source]

Bases: object

Encapsulates the data loader library and exposes an API to iterate over generic data (images, video or audio given in compressed form). An index file that maps the data examples to their targets is expected to be provided in CSV format.

Parameters:
  • config (dict) – All configuration information needed for defining the type of extraction, transforming, and loading of targets, as well as where source files come from, where the files should be cached locally, etc.
  • backend (object) – This is an instance of an object which knows how to create tensors it needs for processing, and how to transfer host information to those tensors

Note that if the epoch is not evenly divisible by the minibatch size, there will be one minibatch per epoch (or so) which contains data from two epochs.

config

Dataloader configuration

item_count

Number of items in the dataset.

minibatch_index(epoch_index)[source]

returns the minibatch_index that epoch_index starts with

nbatches

Returns the number of minibatches in this dataset in this epoch.

Sometimes the number of minibatches per epoch changes since items from the next epoch will be used to fill the last minibatch of an epoch if it doesn’t line up with the end of the epoch.

nbatches_at_epoch(epoch_index)[source]

returns the number of minibatches which will be in epoch # epoch_index

ndata
next()[source]

return one minibatch in a (data, targets) tuple

reset()[source]

Restart data from index 0.

shape
shapes()[source]

C api wrapper with exception handling

start_item_index(epoch_index)[source]

The starting item offset for epoch # epoch_index

assumes 0 indexed epochs

unending_iter()[source]

never ending iterator over dataset.