Deep Learning Models#

Neural network models for rating prediction, ranking, and top-N recommendation.

Production models (CI-tested)#

These models live under corerec.engines.*, inherit BaseRecommender, and pass automated tests on every commit.

Model

Import

Tutorial

DCN

from corerec.engines.dcn import DCN

DCN Tutorial

DeepFM

from corerec.engines.deepfm import DeepFM

DeepFM Tutorial

SASRec

from corerec.engines.sasrec import SASRec

SASRec Tutorial

TwoTower

from corerec.engines.two_tower import TwoTower

TwoTower Tutorial

Example (triplet-based models)#

Most production deep models accept (user_ids, item_ids, ratings) triplets. Use binary (0/1) or normalized ratings for models trained with BCE loss (e.g. GNNRec).

from corerec.engines.dcn import DCN

model = DCN(embedding_dim=64, epochs=20, verbose=True)
model.fit(user_ids=user_ids, item_ids=item_ids, ratings=ratings)

score = model.predict(user_id=1, item_id=100)
recs = model.recommend(user_id=1, top_k=10)
model.save("artifacts/dcn")  # safe bundle by default

SASRec and BERT4Rec use an interaction matrix instead of raw triplets — see their tutorials.

Sandbox models (experimental)#

Implementations under corerec/sandbox/. Not production-tested.

Model

Import path

Tutorial

AFM

corerec.sandbox.collaborative_full.nn_base.AFM_base

AFM

AutoInt

corerec.sandbox.collaborative_full.nn_base.AutoInt_base

AutoInt

AutoFI

corerec.sandbox.collaborative_full.nn_base.AutoFI_base

AutoFI

BST

corerec.sandbox.collaborative_full.nn_base.BST_base

BST

BiVAE

corerec.sandbox.collaborative_full.variational_encoder_base.bivae_base

BiVAE

Caser

corerec.sandbox.collaborative_full.nn_base.caser

Caser

DeepCrossing

sandbox nn_base

DeepCrossing

DeepRec

corerec.sandbox.collaborative_full.nn_base.DeepRec_base

DeepRec

DIEN

corerec.sandbox.collaborative_full.nn_base.DIEN_base

DIEN

DiFM

sandbox nn_base

DiFM

DIN

corerec.sandbox.collaborative_full.nn_base.DIN_base

DIN

DLRM

corerec.sandbox.collaborative_full.nn_base.DLRM_base

DLRM

ENSFM

corerec.sandbox.collaborative_full.nn_base.ENSFM_base

ENSFM

ESCM2

corerec.sandbox.collaborative_full.nn_base.ESCMM_base

ESCMM

ESMM

corerec.sandbox.collaborative_full.nn_base.ESMM_base

ESMM

FGCNN

corerec.sandbox.collaborative_full.nn_base.FGCNN_base

FGCNN

FFM

corerec.sandbox.collaborative_full.nn_base.FFM_base

FFM

FiBiNet

corerec.sandbox.collaborative_full.nn_base.Fibinet_base

FiBiNet

FLEN

corerec.sandbox.collaborative_full.nn_base.FLEN_base

FLEN

FM

corerec.sandbox.collaborative_full.nn_base.FM_base

FM

GAN-Rec

corerec.sandbox.collaborative_full.nn_base.gan_ufilter_base

GAN

GateNet

sandbox nn_base

GateNet

GRU-CF

corerec.sandbox.collaborative_full.nn_base.gru_ufilter_base

GRU-CF

NFM

corerec.sandbox.collaborative_full.nn_base.NFM_base

NFM

NextItNet

corerec.sandbox.collaborative_full.sequential_model_base.nextitnet_base

NextItNet

Wide&Deep

corerec.sandbox.collaborative_full.nn_base.WideDeep_base

Wide&Deep

YouTubeDNN

sandbox content nn

YouTubeDNN

PNN

sandbox nn_base

PNN

MMoE

corerec.sandbox.collaborative_full.nn_base.MMoE_base

MMoE

PLE

corerec.sandbox.collaborative_full.nn_base.PLE_base

PLE

TDM

corerec.sandbox.collaborative_full.nn_base.TDM_base

TDM

DCN-Base

corerec.sandbox.collaborative_full.nn_base.DCN

DCN Base

DeepFM-Base

corerec.sandbox.collaborative_full.nn_base.DeepFM_base

DeepFM Base

Sandbox warning

Always import sandbox models from corerec.sandbox.*, not corerec.engines.*. Validate thoroughly before any production use.

When to use deep learning models#

  • Large interaction datasets with non-linear patterns

  • Rich side features (DCN, DeepFM)

  • Sequential behavior (SASRec, BERT4Rec)

  • Graph structure (GNNRec)

  • Multi-interest sessions (MIND)

  • Dual-tower retrieval at scale (TwoTower)

See also#