merlin.models.tf.DLRMBlock#

merlin.models.tf.DLRMBlock(schema: merlin.schema.schema.Schema, *, embedding_dim: Optional[int] = None, embedding_options: Optional[merlin.models.tf.inputs.embedding.EmbeddingOptions] = None, embeddings: Optional[merlin.models.tf.core.base.Block] = None, bottom_block: Optional[merlin.models.tf.core.base.Block] = None, top_block: Optional[merlin.models.tf.core.base.Block] = None) merlin.models.tf.core.combinators.SequentialBlock[source]#
Builds the DLRM architecture, as proposed in the following

`paper https://arxiv.org/pdf/1906.00091.pdf`_ 1.

1

Naumov, Maxim, et al. “Deep learning recommendation model for personalization and recommendation systems.” arXiv preprint arXiv:1906.00091 (2019).

schemaSchema

The Schema with the input features

embedding_dimOptional[int], optional

Dimension of the embeddings, by default None

embedding_optionsEmbeddingOptions

Options for the input embeddings. - embedding_dim_default: int - Default dimension of the embedding table, when the feature is not found in embedding_dims, by default 64 - infer_embedding_sizes : bool, Automatically defines the embedding dimension from the feature cardinality in the schema, by default False, which needs to be kept False for the DLRM architecture.

embeddings: Optional[Block]

If provided creates a ParallelBlock with an EmbeddingTable for each categorical feature in the schema.

bottom_blockBlock

The Block that combines the continuous features (typically a MLPBlock)

top_blockOptional[Block], optional

The optional Block that combines the outputs of bottom layer and of the factorization machine layer, by default None

SequentialBlock

The DLRM block

ValueError

The schema is required by DLRM

ValueError

The bottom_block is required by DLRM

ValueError

The embedding_dim (X) needs to match the last layer of bottom MLP (Y).

ValueError

Only one-of embeddings or embedding_options can be used.