merlin.schema.schema.Schema, *, embedding_dim: Optional[int] = None, embedding_options: Optional[] = None, embeddings: Optional[] = None, bottom_block: Optional[] = None, top_block: Optional[] = None)[source]#
Builds the DLRM architecture, as proposed in the following

`paper`_ 1.


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


The Schema with the input features

embedding_dimOptional[int], optional

Dimension of the embeddings, by default None


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.


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


The DLRM block


The schema is required by DLRM


The bottom_block is required by DLRM


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


Only one-of embeddings or embedding_options can be used.