generic.Model#
- class maite.protocols.generic.Model(*args, **kwargs)[source]#
Generic version of a protocol that specifies inference behavior on data batches.
Implementers must provide a
__call__method that operates on a batch of model inputs (asSequence[InputType]) and returns a batch of model targets (asSequence[TargetType]).Note: In practice, this class is specialized within AI-problem specific submodules using structural types for
InputTypeandTargetType. 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.