kaira.models.generic.IdentityModel

Inheritance diagram of IdentityModel

Inheritance diagram for IdentityModel

class kaira.models.generic.IdentityModel[source]

Bases: BaseModel

Identity Model.

This model returns the input tensor without any modifications. It can be used as a baseline model or as a placeholder in model pipelines.

Example

>>> model = IdentityModel()
>>> x = torch.randn(5, 10)
>>> output = model(x)
>>> assert torch.allclose(x, output)

Methods

__init__

Initialize the IdentityModel.

forward

Forward pass through the model.

__init__()[source]

Initialize the IdentityModel.

forward(x: Tensor, *args: Any, **kwargs: Any) Tensor[source]

Forward pass through the model.

Parameters:
  • x (torch.Tensor) – The input tensor.

  • *args – Additional positional arguments

  • **kwargs – Additional keyword arguments

Returns:

The input tensor (unchanged).

Return type:

torch.Tensor