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

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.

abstractmethod 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 to perform the forward pass, and compute the loss if needed.

Returns:

A dictionary containing the output tensors.