oumi.core.models#
Core models module for the Oumi (Open Universal Machine Intelligence) library.
This module provides base classes for different types of models used in the Oumi framework.
See also
oumi.models
: Module containing specific model implementations.oumi.models.mlp.MLPEncoder
: An example of a concrete modelimplementation.
Example
To create a custom model, inherit from BaseModel
:
>>> from oumi.core.models import BaseModel
>>> class CustomModel(BaseModel):
... def __init__(self, *args, **kwargs):
... super().__init__(*args, **kwargs)
...
... def forward(self, x):
... # Implement the forward pass
... pass
- class oumi.core.models.BaseModel(**kwargs)[source]#
Bases:
Module
,ABC
- abstract property criterion: Callable#
Returns the criterion function used for model training.
- Returns:
A callable object representing the criterion function.
- abstract forward(**kwargs) dict[str, Tensor] [source]#
Performs the forward pass of the model.
Optionally computes the loss if the necessary keyword arguments are provided.
- Parameters:
**kwargs – should contain all the parameters needed
pass (to perform the forward)
needed. (and compute the loss if)
- Returns:
A dictionary containing the output tensors.