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, bottom_block: Optional[merlin.models.tf.core.base.Block] = None, top_block: Optional[merlin.models.tf.core.base.Block] = None, embeddings: 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.

References

1

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

Parameters
  • schema (Schema) – The Schema with the input features

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

  • top_block (Optional[Block], optional) – The optional Block that combines the outputs of bottom layer and of the factorization machine layer, by default None

  • embedding_dim (Optional[int], optional) – Dimension of the embeddings, by default None

  • embedding_options (EmbeddingOptions) – 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.

Returns

The DLRM block

Return type

SequentialBlock

Raises
  • 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.