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 (as Sequence [InputType]) and returns a batch of model targets (as Sequence [TargetType]).

Note: In practice, this class is specialized within AI-problem specific submodules using structural types for InputType and TargetType. 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 as Any-type, effectively masking potential type incompatibilities.