bitorch.models.dlrm.DLRM

class bitorch.models.dlrm.DLRM(dense_feature_size: int, embedding_layer_sizes: List[int], input_shape: List[int] = [], bottom_mlp_layer_sizes: Union[List[int], str] = [512, 256, 64], top_mlp_layer_sizes: Union[List[int], str] = [512, 256, 1], interaction_operation: str = 'product', binary_bottom_mlp: bool = False, binary_top_mlp: bool = True, binary_embedding: bool = True, embedding_dimension: int = 16, **kwargs: Any)[source]

Methods

__init__

Initializes internal Module state, shared by both nn.Module and ScriptModule.

add_argparse_arguments

allows additions to the argument parser if required, e.g.

feature_interaction

forward

forwards the input tensor through the model.

forward_embeddings

forwards the preprocessed data through the embedding layers.

Attributes

inference_speed

name

total_size

validation_results

__init__(dense_feature_size: int, embedding_layer_sizes: List[int], input_shape: List[int] = [], bottom_mlp_layer_sizes: Union[List[int], str] = [512, 256, 64], top_mlp_layer_sizes: Union[List[int], str] = [512, 256, 1], interaction_operation: str = 'product', binary_bottom_mlp: bool = False, binary_top_mlp: bool = True, binary_embedding: bool = True, embedding_dimension: int = 16, **kwargs: Any) None[source]

Initializes internal Module state, shared by both nn.Module and ScriptModule.

static add_argparse_arguments(parent_parser: ArgumentParser) None[source]

allows additions to the argument parser if required, e.g. to add layer count, etc.

! please note that the inferred variable names of additional cli arguments are passed as keyword arguments to the constructor of this class !

Parameters:

parser (ArgumentParser) – the argument parser

forward(dense_values: Tensor, categorical_values: Tensor) Tensor[source]

forwards the input tensor through the model.

Parameters:

x (torch.Tensor) – input tensor

Returns:

the model output

Return type:

torch.Tensor

forward_embeddings(categorical_values_i: Tensor, categorical_values_o: Tensor) List[Tensor][source]

forwards the preprocessed data through the embedding layers.