lisbet.modeling.backbones.base#

Abstract base class for backbone models.

Classes

BackboneInterface(*args, **kwargs)

Abstract base class for all backbone models.

class lisbet.modeling.backbones.base.BackboneInterface(*args, **kwargs)[source]#

Abstract base class for all backbone models.

This interface defines the required methods that all backbone implementations must provide.

abstractmethod forward(x)[source]#

Forward pass through the backbone.

Parameters:

x (Tensor) – Input tensor of shape (batch_size, sequence_length, input_dim).

Returns:

Output tensor of shape (batch_size, sequence_length, output_dim).

Return type:

Tensor

abstractmethod get_config()[source]#

Get the configuration dictionary for this backbone.

Returns:

Configuration dictionary containing all parameters needed to recreate this backbone instance.

Return type:

dict[str, Any]

abstractmethod classmethod from_config(config)[source]#

Create a backbone instance from a configuration dictionary.

Parameters:

config (dict[str, Any]) – Configuration dictionary containing all parameters needed to create the backbone instance.

Returns:

New backbone instance created from the configuration.

Return type:

BackboneInterface