# shenweichen/deepctr-torch

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/shenweichen-deepctr-torch).**

3,376 stars · 733 forks · Python · apache-2.0

## Links

- GitHub: https://github.com/shenweichen/DeepCTR-Torch
- Homepage: https://deepctr-torch.readthedocs.io/en/latest/index.html
- awesome-repositories: https://awesome-repositories.com/repository/shenweichen-deepctr-torch.md

## Topics

`ctr-models` `deep-learning` `deepctr` `deepctr-pytorch` `deepfm` `deeprec` `fibinet` `torchrec` `xdeepfm`

## Description

DeepCTR-Torch is a deep learning library for building click-through rate prediction models. It provides a modular framework for assembling custom prediction architectures from pre-built core, interaction, and sequence layers, enabling the construction of deep neural networks that estimate click probability from user behavior data.

The library specializes in feature interaction modeling, offering components for learning low-order, high-order, and adaptive-order feature crosses. It supports multi-task learning for predicting multiple objectives simultaneously, such as click and conversion rates, using shared representations. Sequence-aware user modeling is also a core capability, with attention and recurrent structures for processing user behavior sequences to capture evolving preferences.

Additional capabilities include dynamic feature selection through squeeze-excitation networks, multi-head self-attention for feature relationships, and gated expert routing for task-specific information processing. The framework handles data preparation tasks like defining sparse and dense features, normalizing numerical inputs, and preprocessing categorical variables.

Models are trained through a simple fit and predict interface without requiring manual training loops, with support for checkpoint saving and early stopping.

## Tags

### Artificial Intelligence & ML

- [Click-Through Rate Predictors](https://awesome-repositories.com/f/artificial-intelligence-ml/learning-rate-finders/click-through-rate-predictors.md) — Builds and trains deep neural networks to predict ad or item click probability from user behavior data.
- [CTR Model Builders](https://awesome-repositories.com/f/artificial-intelligence-ml/deep-learning-toolkits/ctr-model-builders.md) — Modular deep learning toolkit for assembling custom CTR prediction architectures from core, interaction, and sequence layers.
- [Feature Interaction Models](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models.md) — Captures complex relationships between features using specialized neural network layers for higher prediction accuracy.
- [Feature Interaction Learning Toolkits](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models/feature-interaction-learning-toolkits.md) — Library providing pre-built layers for learning low-order, high-order, and adaptive feature crosses in prediction models.
- [Low-Order Interaction Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models/low-order-interaction-layers.md) — Capture pairwise feature relationships through vector product operations between embeddings. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Expert Routing Gates](https://awesome-repositories.com/f/artificial-intelligence-ml/gated-sequence-models/expert-routing-gates.md) — Implements learned gating functions that route inputs to shared expert modules per task in multi-task CTR models.
- [Deep Click Model Builders](https://awesome-repositories.com/f/artificial-intelligence-ml/learning-rate-finders/click-through-rate-predictors/deep-click-model-builders.md) — Construct a deep neural network for click-through rate prediction using modular building blocks. ([source](https://deepctr-torch.readthedocs.io/en/latest/Layers.html))
- [Custom Neural Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning-implementations/custom-neural-architectures.md) — Combine core neural network layers to construct bespoke prediction architectures. ([source](https://deepctr-torch.readthedocs.io/en/latest/_sources/index.rst.txt))
- [Multi-Task Learning Models](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/sequence-models/multi-task-learning-models.md) — Trains a single model to predict multiple related outcomes simultaneously, such as click and conversion rates, using shared representations.
- [Click-Through Rate Multi-Task Models](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/sequence-models/multi-task-learning-models/click-through-rate-multi-task-models.md) — Framework for training models that predict multiple objectives like click and conversion rates using shared representations.
- [CTR Multi-Task Models](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/sequence-models/multi-task-learning-models/ctr-multi-task-models.md) — Train multiple prediction objectives simultaneously using shared-bottom, ESMM, MMOE, or PLE architectures. ([source](https://deepctr-torch.readthedocs.io/en/latest/History.html))
- [Gated Expert Routing Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/sequence-models/multi-task-learning-models/gated-expert-routing-layers.md) — Use separate gating networks per task to selectively combine outputs from shared expert modules. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Shared-Bottom Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/sequence-models/multi-task-learning-models/shared-bottom-architectures.md) — Shares bottom layers across multiple prediction objectives to learn click and conversion rates simultaneously.
- [Model Architecture Assemblers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-architecture-assemblers.md) — Combine pre-built core, interaction, and sequence layers to build bespoke prediction architectures. ([source](https://deepctr-torch.readthedocs.io/))
- [Modular Layer Compositions](https://awesome-repositories.com/f/artificial-intelligence-ml/model-composition-architectures/hybrid-layer-compositions/modular-layer-compositions.md) — Provides pre-built core, interaction, and sequence layers as interchangeable building blocks for custom prediction architectures.
- [CTR Predictions](https://awesome-repositories.com/f/artificial-intelligence-ml/model-predictions/ctr-predictions.md) — Fit complex models to data and generate predictions through a simple fit and predict interface. ([source](https://deepctr-torch.readthedocs.io/en/latest/_sources/index.rst.txt))
- [Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training.md) — Fit and evaluate complex deep learning models using standard fit and predict methods without writing training loops. ([source](https://deepctr-torch.readthedocs.io/))
- [User Behavior Sequence Training](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training-frameworks/vision-model-training/hybrid-transformer-training/hybrid-sequence-model-training/user-behavior-sequence-training.md) — Process user behavior sequences with attention-based architectures like DIN and DIEN for personalized predictions. ([source](https://deepctr-torch.readthedocs.io/en/latest/History.html))
- [Variable-Length Sequence Training](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training-frameworks/vision-model-training/hybrid-transformer-training/hybrid-sequence-model-training/user-behavior-sequence-training/variable-length-sequence-training.md) — Train a deep learning model that accepts variable-length sequence inputs by padding and encoding them as sparse features. ([source](https://deepctr-torch.readthedocs.io/en/latest/Examples.html))
- [Binary Classification Training](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training/binary-classification-training.md) — Train a deep learning model on sparse and dense features to predict a binary outcome like ad click-through rate. ([source](https://deepctr-torch.readthedocs.io/en/latest/Examples.html))
- [Click-Through Rate](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training/click-through-rate.md) — Train a deep learning model on user behavior data to predict ad or item click probability. ([source](https://deepctr-torch.readthedocs.io/en/latest/Models.html))
- [Click-Through Rate Predictors](https://awesome-repositories.com/f/artificial-intelligence-ml/predictive-model-basics/click-through-rate-predictors.md) — Construct deep learning architectures for click-through rate prediction using modular components for feature interactions and user behavior. ([source](https://cdn.jsdelivr.net/gh/shenweichen/deepctr-torch@master/README.md))
- [User Behavior](https://awesome-repositories.com/f/artificial-intelligence-ml/sequence-modeling/user-behavior.md) — Processes sequences of user actions with attention and recurrent structures to model evolving user preferences.
- [Sequence-Aware CTR Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/sequence-modeling/user-behavior/sequence-aware-ctr-libraries.md) — Library for processing user behavior sequences with attention mechanisms to model evolving user interests in CTR prediction.
- [Sparse-to-Dense Embedding Tables](https://awesome-repositories.com/f/artificial-intelligence-ml/speaker-embeddings/embedding-management/feature-embedding-tables/sparse-to-dense-embedding-tables.md) — Provides configurable embedding tables that transform sparse categorical inputs into dense vectors for CTR prediction.
- [Squeeze-and-Excitation Attention](https://awesome-repositories.com/f/artificial-intelligence-ml/attention-mechanisms/squeeze-and-excitation-attention.md) — Uses squeeze-and-excitation attention to dynamically rank feature importance per instance for CTR prediction.
- [Per-Instance Feature Importance](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-fusion-architectures/dynamic-feature-fusion/per-instance-feature-importance.md) — Ranks features by relevance per instance using a squeeze-excitation network to weight feature importance dynamically. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Adaptive-Order Crosses](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models/adaptive-order-crosses.md) — Discovers arbitrary-order feature combinations from data using a logarithmic transformation layer. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Attention-Weighted Feature Pairs](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models/attention-weighted-feature-pairs.md) — Weights the importance of different feature pairs using a neural attention mechanism to learn feature interactions. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Interaction Merging Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models/interaction-merging-layers.md) — Combine multiple feature interaction patterns through dedicated interaction layers. ([source](https://deepctr-torch.readthedocs.io/en/latest/Layers.html))
- [Multi-Head Self-Attention Interactions](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-interaction-models/multi-head-self-attention-interactions.md) — Allows each feature to attend to all others across multiple heads to automatically form meaningful higher-order features. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Post-Click Conversion Estimators](https://awesome-repositories.com/f/artificial-intelligence-ml/learning-rate-finders/click-through-rate-predictors/post-click-conversion-estimators.md) — Compute conversion probability across the full impression space using a multi-task sequential prediction pattern. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Progressive Layer Separation](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/sequence-models/multi-task-learning-models/progressive-layer-separation.md) — Route information through progressive layers that split shared and task-specific components for better multi-task learning. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))
- [Feature Relationship Attention Heads](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-head-attention-mechanisms/feature-relationship-attention-heads.md) — Implements multi-head self-attention to model feature relationships and automatically form meaningful higher-order features.
- [Adaptive-Order Feature Cross Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/tensor-computation-primitives/cumulative-sum-calculators/logarithmic-transformers/logarithmic-transformers/adaptive-order-feature-cross-layers.md) — Ships a logarithmic transformation layer that discovers arbitrary-order feature crosses from input embeddings.

### Part of an Awesome List

- [Click-Through Rate Predictors](https://awesome-repositories.com/f/awesome-lists/ai/deep-learning/click-through-rate-predictors.md) — Construct and train deep neural networks for click-through rate prediction using modular components. ([source](https://deepctr-torch.readthedocs.io/))
- [Deep and Cross Networks](https://awesome-repositories.com/f/awesome-lists/ai/neural-networks-and-deep-learning/deep-and-cross-networks.md) — Combine deep neural networks with explicit cross layers using DCN-M and DCN-Mix architectures. ([source](https://deepctr-torch.readthedocs.io/en/latest/History.html))

### Web Development

- [Sequential](https://awesome-repositories.com/f/web-development/user-profiles/interest-modeling/sequential.md) — Processes user behavior sequences with attention and recurrent structures to model evolving user preferences.

### Data & Databases

- [Memorization and Generalization Combinations](https://awesome-repositories.com/f/data-databases/tabular-data-frameworks/tabular-predictive-models/nonlinear-combination-learning/memorization-and-generalization-combinations.md) — Join handcrafted feature inputs with learned deep representations to produce a single unified prediction. ([source](https://deepctr-torch.readthedocs.io/en/latest/Features.html))

### Software Engineering & Architecture

- [Model Component Assembly](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/yaml-configuration-files/model-component-assembly.md) — Combines pre-built core, interaction, and sequence layers to construct bespoke prediction architectures without writing training loops.
