Skip to main content

A Lighting Pytorch Framework for Recommendation System, Easy-to-use and Easy-to-extend.

Project description

Torch-RecHub

A Lighting Pytorch Framework for Recommendation Models, Easy-to-use and Easy-to-extend.

安装

pip install torch-rechub

主要特性

  • scikit-learn风格易用的API(fit、predict),即插即用

  • 训练过程与模型定义解耦,易拓展,可针对不同类型的模型设置不同的训练机制

  • 使用Pytorch原生Dataset、DataLoader,易修改,自定义数据

  • 高度模块化,支持常见Layer(MLP、FM、FFM、target-attention、self-attention、transformer等),容易调用组装成新模型

  • 支持常见排序模型(WideDeep、DeepFM、DIN、DCN、xDeepFM等)

  • 支持常见召回模型(DSSM、YoutubeDNN、MIND、SARSRec等)

  • 丰富的多任务学习支持

    • SharedBottom、ESMM、MMOE、PLE、AITM等模型
    • GradNorm、UWL等动态loss加权机制
  • 聚焦更生态化的推荐场景

    • 冷启动
    • 延迟反馈
    • 去偏
  • 支持丰富的训练机制(对比学习、蒸馏学习等)

  • 第三方高性能开源Trainer支持(Pytorch Lighting等)

  • 更多模型正在开发中

快速使用

from torch_rechub.models import WideDeep, DeepFM, DIN
from torch_rechub.trainers import CTRTrainer
from torch_rechub.basic.utils import DataGenerator

dg = DataGenerator(x, y)
train_dataloader, val_dataloader, test_dataloader = dg.generate_dataloader()

model = DeepFM(deep_features=deep_features, fm_features=fm_features, mlp_params={"dims": [256, 128], "dropout": 0.2, "activation": "relu"})

ctr_trainer = CTRTrainer(model)
ctr_trainer.fit(train_dataloader, val_dataloader)
auc = ctr_trainer.evaluate(ctr_trainer.model, test_dataloader)

Note:

所有模型均在大多数论文提及的多个知名公开数据集中测试,达到或者接近论文性能。

使用案例:Examples

每个数据集将会提供

  • 一个使用脚本,包含样本生成、模型训练与测试,并提供一套测评所用参数。
  • 一个预处理脚本,将原始数据进行预处理,转化成csv。
  • 数据格式参考文件(100条)。
  • 全量数据,统一的csv文件,提供高速网盘下载链接和原始数据链接。

初步规划TODO清单

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch-rechub-0.0.1.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

torch_rechub-0.0.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file torch-rechub-0.0.1.tar.gz.

File metadata

  • Download URL: torch-rechub-0.0.1.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for torch-rechub-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e0643f0549fcbbb39e94657316a7851d9861d454cb7be52066d18ca9057a0110
MD5 6d5d00091220e9f738f0060b735a5896
BLAKE2b-256 3638d86b7845bfe901abbe0669a002b9aca6a1fd6a6f3ec6211c6b9bfccd41fa

See more details on using hashes here.

File details

Details for the file torch_rechub-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: torch_rechub-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for torch_rechub-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c440f37d801543d8c32ead392a8ffe835a6a837c4bd88fd20e32d964d73b99de
MD5 a84378d73c342af20e88862ef919f8e6
BLAKE2b-256 8eb55a6b46f0cab1e142d45099b0ac1b53a73f638298e256c6f1876b1195bf57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page