generic.DataLoader#
- class maite.protocols.generic.DataLoader(*args, **kwargs)[source]#
Generic version of a protocol that specifies batch-level access to a data source.
Implementers must provide an iterable object (returning an iterator via the
__iter__method) that yields tuples containing batches of data. These tuples contain typesSequence[InputType],Sequence[TargetType], andSequence[DatumMetadataType], which correspond to model input batch, model target type batch, and a datum metadata batch.Note: In practice, this class is specialized within AI-problem specific submodules using structural types for
InputType,TargetType, andDatumMetadataType. Implementing this class directly (i.e., without specializing on concrete types) is not recommended. Static type checkers will effectively consider all non-specified type parameters asAny-type, effectively masking potential type incompatibilities.