Skip to main content

an elegant rec4torch

Project description

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过程(提速)

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

rec4torch-0.0.2.tar.gz (20.3 kB view details)

Uploaded Source

File details

Details for the file rec4torch-0.0.2.tar.gz.

File metadata

  • Download URL: rec4torch-0.0.2.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for rec4torch-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b2efe865cb794d573847a6be11955f547c84f1eaa1a0ab918c4774304fd81643
MD5 befdb851c9404b638b8cd4a2e5ce2bec
BLAKE2b-256 4b97bfe5f667115c4c1822906cca7944c71423d70c75aecd7274bf1037651fba

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