Skip to main content

rec4torch

推荐系统的pytorch算法实现

licence PyPI PyPI - Downloads GitHub stars GitHub Issues contributions welcome

1. 下载安装

安装稳定版

pip install rec4torch

安装最新版

pip install git+https://www.github.com/Tongjilibo/rec4torch.git

2. 功能

  • 核心功能:基于pytorch实现各类推荐算法(DeepFM, WideDeep, DCN, DIN, DIEN)
  • 主要区别:相对于deep-ctr, 去除对tensorflow和keras的依赖,去除重复过embedding的操作,原生支持multiclass
  • 训练过程:
    2022-10-28 23:16:10 - Start Training
    2022-10-28 23:16:10 - Epoch: 1/5
    5000/5000 [==============================] - 13s 3ms/step - loss: 0.1351 - acc: 0.9601
    Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 798.09it/s] 
    test_acc: 0.98045. best_test_acc: 0.98045
    
    2022-10-28 23:16:27 - Epoch: 2/5
    5000/5000 [==============================] - 13s 3ms/step - loss: 0.0465 - acc: 0.9862
    Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 635.78it/s] 
    test_acc: 0.98280. best_test_acc: 0.98280
    
    2022-10-28 23:16:44 - Epoch: 3/5
    5000/5000 [==============================] - 15s 3ms/step - loss: 0.0284 - acc: 0.9915
    Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 673.60it/s] 
    test_acc: 0.98365. best_test_acc: 0.98365
    
    2022-10-28 23:17:03 - Epoch: 4/5
    5000/5000 [==============================] - 15s 3ms/step - loss: 0.0179 - acc: 0.9948
    Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 692.34it/s] 
    test_acc: 0.98265. best_test_acc: 0.98365
    
    2022-10-28 23:17:21 - Epoch: 5/5
    5000/5000 [==============================] - 14s 3ms/step - loss: 0.0129 - acc: 0.9958
    Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 701.77it/s] 
    test_acc: 0.98585. best_test_acc: 0.98585
    
    2022-10-28 23:17:37 - Finish Training
    

3. 快速上手

4. 版本说明

  • v0.0.2:20240204 更新依赖项torch4keras版本
  • v0.0.1:20221027 dcn, deepcrossing, deepfm, din, dien, wide&deep, ncf等模型,训练过程修改为传入dataloader,合并models和layers,合并简化embedding_lookup,去掉一些重复的embedding过程(提速)

5. 更新:

  • 20240204:更新依赖项torch4keras版本
  • 20221110:增加自定义的TensorDataset和collate_fn_device,支持指定device,防止显存占用多大,用out_dim和loss来替代task参数,兼容多分类
  • 20221027:增加deepcrossing, ncf, din, dien算法,使用torch4keras作为trainer
  • 20220930:初版提交, 训练过程修改为传入dataloader(参考bert4torch),合并models和layers(模型结构较简单),合并简化embedding_lookup,去掉一些重复的embedding过程(提速)

Metadata

Release files for rec4torch 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rec4torch 0.0.2
File Size Uploaded Provenance Actions
rec4torch-0.0.2.tar.gz 20.3 kB Without provenance Details for rec4torch-0.0.2.tar.gz

Release files / rec4torch-0.0.2.tar.gz

Download URL rec4torch-0.0.2.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b2efe865cb794d573847a6be11955f547c84f1eaa1a0ab918c4774304fd81643
BLAKE2b-256 checksum
How to use checksums
4b97bfe5f667115c4c1822906cca7944c71423d70c75aecd7274bf1037651fba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.30.0 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.64.1 importlib-metadata/4.8.2 keyring/22.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.8

Security for rec4torch 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page