nextrec 0.4.18__tar.gz → 0.4.33__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nextrec-0.4.18 → nextrec-0.4.33}/.gitignore +1 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/LICENSE +1 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/PKG-INFO +84 -68
- {nextrec-0.4.18 → nextrec-0.4.33}/README.md +81 -67
- {nextrec-0.4.18 → nextrec-0.4.33}/README_en.md +79 -65
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/en/Getting started guide.md +2 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/conf.py +2 -2
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/index.md +3 -2
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/zh//345/277/253/351/200/237/344/270/212/346/211/213.md +2 -1
- nextrec-0.4.33/nextrec/__version__.py +1 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/activation.py +9 -4
- nextrec-0.4.33/nextrec/basic/asserts.py +72 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/callback.py +39 -87
- nextrec-0.4.33/nextrec/basic/features.py +265 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/heads.py +3 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/layers.py +442 -111
- nextrec-0.4.33/nextrec/basic/loggers.py +431 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/metrics.py +128 -114
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/model.py +550 -446
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/session.py +2 -2
- nextrec-0.4.33/nextrec/basic/summary.py +416 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/cli.py +80 -51
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/data/batch_utils.py +23 -3
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/data/data_processing.py +42 -4
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/data/dataloader.py +32 -12
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/data/preprocessor.py +522 -44
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/loss/__init__.py +0 -4
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/loss/grad_norm.py +3 -3
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/loss/listwise.py +19 -6
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/loss/pairwise.py +6 -4
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/loss/pointwise.py +8 -6
- nextrec-0.4.33/nextrec/models/multi_task/[pre]aitm.py +173 -0
- nextrec-0.4.33/nextrec/models/multi_task/[pre]snr_trans.py +232 -0
- nextrec-0.4.33/nextrec/models/multi_task/[pre]star.py +192 -0
- nextrec-0.4.33/nextrec/models/multi_task/apg.py +330 -0
- nextrec-0.4.33/nextrec/models/multi_task/cross_stitch.py +229 -0
- nextrec-0.4.33/nextrec/models/multi_task/escm.py +290 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/multi_task/esmm.py +11 -49
- nextrec-0.4.33/nextrec/models/multi_task/hmoe.py +203 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/multi_task/mmoe.py +23 -55
- nextrec-0.4.33/nextrec/models/multi_task/pepnet.py +340 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/multi_task/ple.py +49 -84
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/multi_task/poso.py +31 -64
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/multi_task/share_bottom.py +20 -56
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/afm.py +10 -31
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/autoint.py +12 -44
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/dcn.py +12 -32
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/dcn_v2.py +13 -39
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/deepfm.py +10 -35
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/dien.py +16 -38
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/din.py +17 -38
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/eulernet.py +10 -35
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/ffm.py +7 -31
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/fibinet.py +15 -37
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/fm.py +6 -32
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/lr.py +6 -33
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/masknet.py +14 -37
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/pnn.py +10 -32
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/widedeep.py +10 -38
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/xdeepfm.py +13 -38
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/rqvae.py +4 -4
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/retrieval/dssm.py +22 -60
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/retrieval/dssm_v2.py +15 -52
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/retrieval/mind.py +13 -45
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/retrieval/sdm.py +40 -63
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/retrieval/youtube_dnn.py +20 -55
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/sequential/hstu.py +3 -23
- nextrec-0.4.33/nextrec/models/tree_base/__init__.py +15 -0
- nextrec-0.4.33/nextrec/models/tree_base/base.py +693 -0
- nextrec-0.4.33/nextrec/models/tree_base/catboost.py +97 -0
- nextrec-0.4.33/nextrec/models/tree_base/lightgbm.py +69 -0
- nextrec-0.4.33/nextrec/models/tree_base/xgboost.py +61 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/__init__.py +22 -16
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/config.py +18 -5
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/console.py +2 -2
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/feature.py +2 -2
- nextrec-0.4.18/nextrec/loss/loss_utils.py → nextrec-0.4.33/nextrec/utils/loss.py +21 -36
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/model.py +31 -5
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/torch_utils.py +68 -112
- nextrec-0.4.33/nextrec/utils/types.py +100 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/NextRec-CLI.md +51 -128
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/NextRec-CLI_zh.md +50 -127
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/feature_config.yaml +13 -13
- nextrec-0.4.33/nextrec_cli_preset/model_configs/apg.yaml +14 -0
- nextrec-0.4.33/nextrec_cli_preset/model_configs/cross_stitch.yaml +25 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/dcn.yaml +1 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/deepfm.yaml +1 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/din.yaml +4 -3
- nextrec-0.4.33/nextrec_cli_preset/model_configs/escm.yaml +21 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/esmm.yaml +4 -4
- nextrec-0.4.33/nextrec_cli_preset/model_configs/fibinet.yaml +16 -0
- nextrec-0.4.33/nextrec_cli_preset/model_configs/hmoe.yaml +35 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/masknet.yaml +1 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/mmoe.yaml +5 -5
- nextrec-0.4.33/nextrec_cli_preset/model_configs/pepnet.yaml +26 -0
- nextrec-0.4.33/nextrec_cli_preset/model_configs/ple.yaml +33 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/pnn.yaml +1 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/poso.yaml +3 -4
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/share_bottom.yaml +5 -5
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/widedeep.yaml +1 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/xdeepfm.yaml +1 -1
- nextrec-0.4.33/nextrec_cli_preset/train_config.yaml +53 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/train_config_template.yaml +18 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/pyproject.toml +3 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/requirements.txt +3 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/conftest.py +3 -3
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_layers.py +72 -10
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_losses.py +54 -1
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_match_models.py +15 -15
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_multitask_models.py +238 -95
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_ranking_models.py +60 -45
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/example_match.py +2 -2
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/example_multitask.py +19 -26
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/example_ranking_din.py +10 -11
- nextrec-0.4.33/tutorials/example_tree.py +97 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/movielen_match_dssm.py +3 -3
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/movielen_ranking_deepfm.py +5 -3
- nextrec-0.4.33/tutorials/notebooks/en/Hands on nextrec.ipynb +1687 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/notebooks/zh//344/275/277/347/224/250RQ-VAE/346/236/204/345/273/272/350/257/255/344/271/211ID.ipynb +65 -46
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/notebooks/zh//345/246/202/344/275/225/344/275/277/347/224/250DataProcessor/350/277/233/350/241/214/351/242/204/345/244/204/347/220/206.ipynb +115 -61
- nextrec-0.4.33/tutorials/notebooks/zh//345/277/253/351/200/237/345/205/245/351/227/250nextrec.ipynb +1987 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/run_all_match_models.py +25 -11
- nextrec-0.4.33/tutorials/run_all_multitask_models.py +285 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/run_all_ranking_models.py +12 -10
- nextrec-0.4.18/nextrec/__version__.py +0 -1
- nextrec-0.4.18/nextrec/basic/features.py +0 -144
- nextrec-0.4.18/nextrec/basic/loggers.py +0 -217
- nextrec-0.4.18/nextrec_cli_preset/model_configs/fibinet.yaml +0 -14
- nextrec-0.4.18/nextrec_cli_preset/model_configs/ple.yaml +0 -30
- nextrec-0.4.18/nextrec_cli_preset/train_config.yaml +0 -37
- nextrec-0.4.18/tutorials/notebooks/en/Hands on nextrec.ipynb +0 -1652
- nextrec-0.4.18/tutorials/notebooks/zh//345/277/253/351/200/237/345/205/245/351/227/250nextrec.ipynb +0 -1647
- nextrec-0.4.18/tutorials/run_all_multitask_models.py +0 -179
- {nextrec-0.4.18 → nextrec-0.4.33}/.github/workflows/publish.yml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/.github/workflows/tests.yml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/.readthedocs.yaml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/CODE_OF_CONDUCT.md +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/CONTRIBUTING.md +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/MANIFEST.in +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/Feature Configuration.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/Model Parameters.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/Training Configuration.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/Training logs.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/logo.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/mmoe_tutorial.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/nextrec_diagram.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/assets/test data.png +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/dataset/ctcvr_task.csv +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/dataset/ecommerce_task.csv +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/dataset/match_task.csv +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/dataset/movielens_100k.csv +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/dataset/multitask_task.csv +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/dataset/ranking_task.csv +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/Makefile +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/make.bat +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/modules.rst +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/nextrec.basic.rst +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/nextrec.data.rst +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/nextrec.loss.rst +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/nextrec.rst +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/nextrec.utils.rst +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/docs/rtd/requirements.txt +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/basic/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/data/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/data/data_utils.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/generative/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/generative/tiger.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/multi_task/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/ranking/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/autorec.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/bpr.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/cl4srec.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/lightgcn.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/mf.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/representation/s3rec.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/retrieval/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/models/sequential/sasrec.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/data.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec/utils/embedding.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/afm.yaml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/autoint.yaml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/model_configs/fm.yaml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/predict_config.yaml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/nextrec_cli_preset/predict_config_template.yaml +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/pytest.ini +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/scripts/format_code.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/__init__.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/helpers.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/run_tests.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_base_model_regularization.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_generative_models.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_preprocessor.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_utils_console.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_utils_data.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test/test_utils_embedding.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/test_requirements.txt +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/distributed/example_distributed_training.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/distributed/example_distributed_training_large_dataset.py +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/notebooks/en/Build semantic ID with RQ-VAE.ipynb +0 -0
- {nextrec-0.4.18 → nextrec-0.4.33}/tutorials/notebooks/en/Hands on dataprocessor.ipynb +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nextrec
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.33
|
|
4
4
|
Summary: A comprehensive recommendation library with match, ranking, and multi-task learning models
|
|
5
5
|
Project-URL: Homepage, https://github.com/zerolovesea/NextRec
|
|
6
6
|
Project-URL: Repository, https://github.com/zerolovesea/NextRec
|
|
@@ -42,9 +42,11 @@ Requires-Dist: scipy<1.12,>=1.8; sys_platform == 'linux' and python_version < '3
|
|
|
42
42
|
Requires-Dist: scipy>=1.10.0; sys_platform == 'darwin'
|
|
43
43
|
Requires-Dist: scipy>=1.10.0; sys_platform == 'win32'
|
|
44
44
|
Requires-Dist: scipy>=1.11.0; sys_platform == 'linux' and python_version >= '3.12'
|
|
45
|
+
Requires-Dist: swanlab>=0.7.2
|
|
45
46
|
Requires-Dist: torch>=2.0.0
|
|
46
47
|
Requires-Dist: torchvision>=0.15.0
|
|
47
48
|
Requires-Dist: transformers>=4.38.0
|
|
49
|
+
Requires-Dist: wandb>=0.23.1
|
|
48
50
|
Provides-Extra: dev
|
|
49
51
|
Requires-Dist: jupyter>=1.0.0; extra == 'dev'
|
|
50
52
|
Requires-Dist: matplotlib>=3.7.0; extra == 'dev'
|
|
@@ -63,12 +65,12 @@ Description-Content-Type: text/markdown
|
|
|
63
65
|
|
|
64
66
|
<div align="center">
|
|
65
67
|
|
|
66
|
-
[](https://pypistats.org/packages/nextrec)
|
|
67
69
|

|
|
68
70
|

|
|
69
71
|

|
|
70
|
-

|
|
73
|
+
[](https://deepwiki.com/zerolovesea/NextRec)
|
|
72
74
|
|
|
73
75
|
中文文档 | [English Version](README_en.md)
|
|
74
76
|
|
|
@@ -100,13 +102,14 @@ NextRec是一个基于PyTorch的现代推荐系统框架,旨在为研究工程
|
|
|
100
102
|
- **高效训练与评估**:内置多种优化器、学习率调度、早停、模型检查点与详细的日志管理,开箱即用。
|
|
101
103
|
|
|
102
104
|
## NextRec近期进展
|
|
103
|
-
|
|
105
|
+
- **01/01/2026** 新年好,在v0.4.27中加入了多个多目标模型的支持:[APG](nextrec/models/multi_task/apg.py), [ESCM](nextrec/models/multi_task/escm.py), [HMoE](nextrec/models/multi_task/hmoe.py), [Cross Stitch](nextrec/models/multi_task/cross_stitch.py)
|
|
106
|
+
- **28/12/2025** 在v0.4.21中加入了对SwanLab和Wandb的支持,通过model的`fit`方法进行配置:`use_swanlab=True, swanlab_kwargs={"project": "NextRec","name":"tutorial_movielens_deepfm"},`
|
|
104
107
|
- **21/12/2025** 在v0.4.16中加入了对[GradNorm](/nextrec/loss/grad_norm.py)的支持,通过compile的`loss_weight='grad_norm'`进行配置
|
|
105
108
|
- **12/12/2025** 在v0.4.9中加入了[RQ-VAE](/nextrec/models/representation/rqvae.py)模块。配套的[数据集](/dataset/ecommerce_task.csv)和[代码](tutorials/notebooks/zh/使用RQ-VAE构建语义ID.ipynb)已经同步在仓库中
|
|
106
109
|
- **07/12/2025** 发布了NextRec CLI命令行工具,它允许用户根据配置文件进行一键训练和推理,我们提供了相关的[教程](/nextrec_cli_preset/NextRec-CLI_zh.md)和[教学代码](/nextrec_cli_preset)
|
|
107
110
|
- **03/12/2025** NextRec获得了100颗🌟!感谢大家的支持
|
|
108
111
|
- **06/12/2025** 在v0.4.1中支持了单机多卡的分布式DDP训练,并且提供了配套的[代码](tutorials/distributed)
|
|
109
|
-
- **11/11/2025** NextRec v0.1.0发布,我们提供了10余种Ranking模型,
|
|
112
|
+
- **11/11/2025** NextRec v0.1.0发布,我们提供了10余种Ranking模型,11种多任务模型和4种召回模型,以及统一的训练/日志/指标管理系统
|
|
110
113
|
|
|
111
114
|
## 架构
|
|
112
115
|
|
|
@@ -180,7 +183,7 @@ sequence_features = [
|
|
|
180
183
|
SequenceFeature(name='sequence_1', vocab_size=int(df['sequence_1'].apply(lambda x: max(x)).max() + 1), embedding_dim=16, padding_idx=0, embedding_name='sparse_0_emb'),]
|
|
181
184
|
|
|
182
185
|
mlp_params = {
|
|
183
|
-
"
|
|
186
|
+
"hidden_dims": [256, 128, 64],
|
|
184
187
|
"activation": "relu",
|
|
185
188
|
"dropout": 0.3,
|
|
186
189
|
}
|
|
@@ -189,20 +192,20 @@ model = DIN(
|
|
|
189
192
|
dense_features=dense_features,
|
|
190
193
|
sparse_features=sparse_features,
|
|
191
194
|
sequence_features=sequence_features,
|
|
195
|
+
behavior_feature_name="sequence_0",
|
|
196
|
+
candidate_feature_name="item_id",
|
|
192
197
|
mlp_params=mlp_params,
|
|
193
|
-
|
|
194
|
-
|
|
198
|
+
attention_mlp_params={
|
|
199
|
+
"hidden_dims": [80, 40],
|
|
200
|
+
"activation": "sigmoid",
|
|
201
|
+
},
|
|
195
202
|
attention_use_softmax=True,
|
|
196
|
-
target=
|
|
197
|
-
device='
|
|
198
|
-
embedding_l1_reg=1e-6,
|
|
199
|
-
embedding_l2_reg=1e-5,
|
|
200
|
-
dense_l1_reg=1e-5,
|
|
201
|
-
dense_l2_reg=1e-4,
|
|
203
|
+
target='label', # 目标变量
|
|
204
|
+
device='cpu',
|
|
202
205
|
session_id="din_tutorial", # 实验id,用于存放训练日志
|
|
203
206
|
)
|
|
204
207
|
|
|
205
|
-
#
|
|
208
|
+
# 编译模型,优化器/损失/学习率调度器统一在 compile 中设置
|
|
206
209
|
model.compile(
|
|
207
210
|
optimizer = "adam",
|
|
208
211
|
optimizer_params = {"lr": 1e-3, "weight_decay": 1e-5},
|
|
@@ -216,7 +219,13 @@ model.fit(
|
|
|
216
219
|
epochs=3,
|
|
217
220
|
batch_size=512,
|
|
218
221
|
shuffle=True,
|
|
219
|
-
user_id_column='user_id'
|
|
222
|
+
user_id_column='user_id', # 用于计算GAUC的id列
|
|
223
|
+
valid_ratio=0.2, # 自动划分验证集(可选)
|
|
224
|
+
num_workers=4, # DataLoader 并行数
|
|
225
|
+
use_wandb=False, # 启用 Wandb(可选)
|
|
226
|
+
wandb_kwargs={"project": "NextRec", "name": "din_tutorial"},
|
|
227
|
+
use_swanlab=False, # 启用 SwanLab(可选)
|
|
228
|
+
swanlab_kwargs={"project": "NextRec", "name": "din_tutorial"},
|
|
220
229
|
)
|
|
221
230
|
|
|
222
231
|
# 训练完成后进行指标评估
|
|
@@ -243,11 +252,13 @@ nextrec --mode=train --train_config=path/to/train_config.yaml
|
|
|
243
252
|
nextrec --mode=predict --predict_config=path/to/predict_config.yaml
|
|
244
253
|
```
|
|
245
254
|
|
|
246
|
-
|
|
255
|
+
预测结果固定保存到 `{checkpoint_path}/predictions/{name}.{save_data_format}`。
|
|
256
|
+
|
|
257
|
+
> 截止当前版本0.4.33,NextRec CLI支持单机训练,分布式训练相关功能尚在开发中。
|
|
247
258
|
|
|
248
259
|
## 兼容平台
|
|
249
260
|
|
|
250
|
-
当前最新版本为0.4.
|
|
261
|
+
当前最新版本为0.4.33,所有模型和测试代码均已在以下平台通过验证,如果开发者在使用中遇到兼容问题,请在issue区提出错误报告及系统版本:
|
|
251
262
|
|
|
252
263
|
| 平台 | 配置 |
|
|
253
264
|
|------|------|
|
|
@@ -260,69 +271,74 @@ nextrec --mode=predict --predict_config=path/to/predict_config.yaml
|
|
|
260
271
|
|
|
261
272
|
### 排序模型
|
|
262
273
|
|
|
263
|
-
| 模型 | 论文 |
|
|
264
|
-
|
|
265
|
-
| [FM](nextrec/models/ranking/fm.py) | Factorization
|
|
266
|
-
| [LR](nextrec/models/ranking/lr.py) | Logistic Regression |
|
|
267
|
-
| [AFM](nextrec/models/ranking/afm.py) | Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks |
|
|
268
|
-
| [FFM](nextrec/models/ranking/ffm.py) | Field-aware Factorization Machines
|
|
269
|
-
| [DeepFM](nextrec/models/ranking/deepfm.py) | DeepFM: A
|
|
270
|
-
| [Wide&Deep](nextrec/models/ranking/widedeep.py) | Wide & Deep
|
|
271
|
-
| [xDeepFM](nextrec/models/ranking/xdeepfm.py) |
|
|
272
|
-
| [FiBiNET](nextrec/models/ranking/fibinet.py) | FiBiNET: Combining
|
|
273
|
-
| [PNN](nextrec/models/ranking/pnn.py) | Product-based
|
|
274
|
-
| [AutoInt](nextrec/models/ranking/autoint.py) | AutoInt: Automatic
|
|
275
|
-
| [DCN](nextrec/models/ranking/dcn.py) | Deep &
|
|
276
|
-
| [DCN v2](nextrec/models/ranking/dcn_v2.py) | DCN V2: Improved Deep & Cross Network and Practical Lessons for Web-scale Learning to Rank Systems |
|
|
277
|
-
| [DIN](nextrec/models/ranking/din.py) | Deep
|
|
278
|
-
| [DIEN](nextrec/models/ranking/dien.py) | Deep
|
|
279
|
-
| [MaskNet](nextrec/models/ranking/masknet.py) | MaskNet: Introducing Feature-
|
|
280
|
-
| [EulerNet](nextrec/models/ranking/eulernet.py) | EulerNet: Efficient and Effective Feature Interaction Modeling with Euler's Formula |
|
|
274
|
+
| 模型 | 论文 | 状态 |
|
|
275
|
+
| ------ | ------ | ------ |
|
|
276
|
+
| [FM](nextrec/models/ranking/fm.py) | Factorization machines | 已支持 |
|
|
277
|
+
| [LR](nextrec/models/ranking/lr.py) | Applied Logistic Regression | 已支持 |
|
|
278
|
+
| [AFM](nextrec/models/ranking/afm.py) | Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks | 已支持 |
|
|
279
|
+
| [FFM](nextrec/models/ranking/ffm.py) | Field-aware Factorization Machines for CTR Prediction | 已支持 |
|
|
280
|
+
| [DeepFM](nextrec/models/ranking/deepfm.py) | DeepFM: A factorization-machine based neural network for CTR prediction | 已支持 |
|
|
281
|
+
| [Wide&Deep](nextrec/models/ranking/widedeep.py) | Wide & Deep learning for recommender systems | 已支持 |
|
|
282
|
+
| [xDeepFM](nextrec/models/ranking/xdeepfm.py) | xdeepfm: Combining explicit and implicit feature interactions for recommender systems | 已支持 |
|
|
283
|
+
| [FiBiNET](nextrec/models/ranking/fibinet.py) | FiBiNET: Combining feature importance and bilinear feature interaction for click-through rate prediction | 已支持 |
|
|
284
|
+
| [PNN](nextrec/models/ranking/pnn.py) | Product-based neural networks for user response prediction | 已支持 |
|
|
285
|
+
| [AutoInt](nextrec/models/ranking/autoint.py) | AutoInt: Automatic feature interaction learning via self-attentive neural networks | 已支持 |
|
|
286
|
+
| [DCN](nextrec/models/ranking/dcn.py) | Deep & cross network for ad click predictions | 已支持 |
|
|
287
|
+
| [DCN v2](nextrec/models/ranking/dcn_v2.py) | DCN V2: Improved Deep & Cross Network and Practical Lessons for Web-scale Learning to Rank Systems | 已支持 |
|
|
288
|
+
| [DIN](nextrec/models/ranking/din.py) | Deep interest network for click-through rate prediction | 已支持 |
|
|
289
|
+
| [DIEN](nextrec/models/ranking/dien.py) | Deep interest evolution network for click-through rate prediction | 已支持 |
|
|
290
|
+
| [MaskNet](nextrec/models/ranking/masknet.py) | MaskNet: Introducing Feature-Wise Multiplication to CTR Ranking Models by Instance-Guided Mask | 已支持 |
|
|
291
|
+
| [EulerNet](nextrec/models/ranking/eulernet.py) | EulerNet: Efficient and Effective Feature Interaction Modeling with Euler's Formula | 已支持 |
|
|
281
292
|
|
|
282
293
|
### 召回模型
|
|
283
294
|
|
|
284
|
-
| 模型 | 论文 |
|
|
285
|
-
|
|
286
|
-
| [DSSM](nextrec/models/retrieval/dssm.py) | Learning
|
|
287
|
-
| [DSSM v2](nextrec/models/retrieval/dssm_v2.py) | DSSM with pairwise
|
|
288
|
-
| [YouTube DNN](nextrec/models/retrieval/youtube_dnn.py) | Deep
|
|
289
|
-
| [MIND](nextrec/models/retrieval/mind.py) | Multi-
|
|
290
|
-
| [SDM](nextrec/models/retrieval/sdm.py) | Sequential
|
|
295
|
+
| 模型 | 论文 | 状态 |
|
|
296
|
+
| ------ | ------ | ------ |
|
|
297
|
+
| [DSSM](nextrec/models/retrieval/dssm.py) | Learning deep structured semantic models for web search using clickthrough data | 已支持 |
|
|
298
|
+
| [DSSM v2](nextrec/models/retrieval/dssm_v2.py) | DSSM v2 - DSSM with pairwise training using BPR loss | 已支持 |
|
|
299
|
+
| [YouTube DNN](nextrec/models/retrieval/youtube_dnn.py) | Deep neural networks for youtube recommendations | 已支持 |
|
|
300
|
+
| [MIND](nextrec/models/retrieval/mind.py) | Multi-interest network with dynamic routing for recommendation at Tmall | 已支持 |
|
|
301
|
+
| [SDM](nextrec/models/retrieval/sdm.py) | Sequential recommender system based on hierarchical attention networks | 已支持 |
|
|
291
302
|
|
|
292
303
|
### 序列推荐模型
|
|
293
304
|
|
|
294
|
-
| 模型 | 论文 |
|
|
295
|
-
|
|
296
|
-
| [SASRec](nextrec/models/sequential/sasrec.py) | Self-Attentive Sequential Recommendation |
|
|
297
|
-
| [HSTU](nextrec/models/sequential/hstu.py) | Actions speak louder than words: Trillion-parameter sequential transducers for generative recommendations |
|
|
305
|
+
| 模型 | 论文 | 状态 |
|
|
306
|
+
| ------ | ------ | ------ |
|
|
307
|
+
| [SASRec](nextrec/models/sequential/sasrec.py) | Self-Attentive Sequential Recommendation | 开发中 |
|
|
308
|
+
| [HSTU](nextrec/models/sequential/hstu.py) | Actions speak louder than words: Trillion-parameter sequential transducers for generative recommendations | 已支持 |
|
|
298
309
|
|
|
299
310
|
### 多任务模型
|
|
300
311
|
|
|
301
|
-
| 模型 | 论文 |
|
|
302
|
-
|
|
303
|
-
| [MMOE](nextrec/models/multi_task/mmoe.py) | Modeling Task Relationships in Multi-task Learning
|
|
304
|
-
| [PLE](nextrec/models/multi_task/ple.py) | Progressive Layered Extraction
|
|
305
|
-
| [ESMM](nextrec/models/multi_task/esmm.py) | Entire Space Multi-Task Model
|
|
306
|
-
| [ShareBottom](nextrec/models/multi_task/share_bottom.py) | Multitask Learning |
|
|
307
|
-
| [POSO](nextrec/models/multi_task/poso.py) | POSO: Personalized Cold
|
|
312
|
+
| 模型 | 论文 | 状态 |
|
|
313
|
+
| ------ | ------ | ------ |
|
|
314
|
+
| [MMOE](nextrec/models/multi_task/mmoe.py) | Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts | 已支持 |
|
|
315
|
+
| [PLE](nextrec/models/multi_task/ple.py) | Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations | 已支持 |
|
|
316
|
+
| [ESMM](nextrec/models/multi_task/esmm.py) | Entire Space Multi-Task Model: An Effective Approach for Estimating Post-Click Conversion Rate | 已支持 |
|
|
317
|
+
| [ShareBottom](nextrec/models/multi_task/share_bottom.py) | Multitask Learning | 已支持 |
|
|
318
|
+
| [POSO](nextrec/models/multi_task/poso.py) | POSO: Personalized Cold Start Modules for Large-scale Recommender Systems | 已支持 |
|
|
319
|
+
| [PEPNet](nextrec/models/multi_task/pepnet.py) | PEPNet: Parameter and Embedding Personalized Network for Infusing with Personalized Prior Information | 已支持 |
|
|
320
|
+
| [APG](nextrec/models/multi_task/apg.py) | APG: Adaptive Parameter Generation Network for Click-Through Rate Prediction | 已支持 |
|
|
321
|
+
| [CrossStitch](nextrec/models/multi_task/cross_stitch.py) | Cross-Stitch Networks for Multi-Task Learning | 已支持 |
|
|
322
|
+
| [ESCM](nextrec/models/multi_task/escm.py) | ESCM²: Entire Space Counterfactual Multi-Task Model for Post-Click Conversion Rate Estimation | 已支持 |
|
|
323
|
+
| [HMOE](nextrec/models/multi_task/hmoe.py) | Improving multi-scenario learning to rank in e-commerce by exploiting task relationships in the label space | 已支持 |
|
|
308
324
|
|
|
309
325
|
### 生成式模型
|
|
310
326
|
|
|
311
|
-
| 模型 | 论文 |
|
|
312
|
-
|
|
313
|
-
| [TIGER](nextrec/models/generative/tiger.py) | Recommender Systems with Generative Retrieval |
|
|
327
|
+
| 模型 | 论文 | 状态 |
|
|
328
|
+
| ------ | ------ | ------ |
|
|
329
|
+
| [TIGER](nextrec/models/generative/tiger.py) | Recommender Systems with Generative Retrieval | 开发中 |
|
|
314
330
|
|
|
315
331
|
### 表征模型
|
|
316
332
|
|
|
317
|
-
| 模型 | 论文 |
|
|
318
|
-
|
|
319
|
-
| [RQ-VAE](nextrec/models/representation/rqvae.py) |
|
|
320
|
-
| [BPR](nextrec/models/representation/bpr.py) | Bayesian Personalized Ranking |
|
|
321
|
-
| [MF](nextrec/models/representation/mf.py) | Matrix Factorization Techniques for Recommender Systems |
|
|
322
|
-
| [AutoRec](nextrec/models/representation/autorec.py) | AutoRec: Autoencoders Meet Collaborative Filtering |
|
|
323
|
-
| [LightGCN](nextrec/models/representation/lightgcn.py) | LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation |
|
|
324
|
-
| [S3Rec](nextrec/models/representation/s3rec.py) | S3-Rec: Self-Supervised Learning for Sequential Recommendation |
|
|
325
|
-
| [CL4SRec](nextrec/models/representation/cl4srec.py) | CL4SRec: Contrastive Learning for Sequential Recommendation |
|
|
333
|
+
| 模型 | 论文 | 状态 |
|
|
334
|
+
| ------ | ------ | ------ |
|
|
335
|
+
| [RQ-VAE](nextrec/models/representation/rqvae.py) | Autoregressive Image Generation using Residual Quantization | 已支持 |
|
|
336
|
+
| [BPR](nextrec/models/representation/bpr.py) | Bayesian Personalized Ranking | 开发中 |
|
|
337
|
+
| [MF](nextrec/models/representation/mf.py) | Matrix Factorization Techniques for Recommender Systems | 开发中 |
|
|
338
|
+
| [AutoRec](nextrec/models/representation/autorec.py) | AutoRec: Autoencoders Meet Collaborative Filtering | 开发中 |
|
|
339
|
+
| [LightGCN](nextrec/models/representation/lightgcn.py) | LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation | 开发中 |
|
|
340
|
+
| [S3Rec](nextrec/models/representation/s3rec.py) | S3-Rec: Self-Supervised Learning for Sequential Recommendation | 开发中 |
|
|
341
|
+
| [CL4SRec](nextrec/models/representation/cl4srec.py) | CL4SRec: Contrastive Learning for Sequential Recommendation | 开发中 |
|
|
326
342
|
|
|
327
343
|
---
|
|
328
344
|
|
|
@@ -384,7 +400,7 @@ NextRec 的开发受到以下优秀项目的启发:
|
|
|
384
400
|
@misc{nextrec,
|
|
385
401
|
title = {NextRec},
|
|
386
402
|
author = {Yang Zhou},
|
|
387
|
-
year = {
|
|
403
|
+
year = {2026},
|
|
388
404
|
publisher = {GitHub},
|
|
389
405
|
journal = {GitHub repository},
|
|
390
406
|
howpublished = {\url{https://github.com/zerolovesea/NextRec}},
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
|
|
7
|
-
[](https://pypistats.org/packages/nextrec)
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|

|
|
11
|
-

|
|
12
|
+
[](https://deepwiki.com/zerolovesea/NextRec)
|
|
13
13
|
|
|
14
14
|
中文文档 | [English Version](README_en.md)
|
|
15
15
|
|
|
@@ -41,13 +41,14 @@ NextRec是一个基于PyTorch的现代推荐系统框架,旨在为研究工程
|
|
|
41
41
|
- **高效训练与评估**:内置多种优化器、学习率调度、早停、模型检查点与详细的日志管理,开箱即用。
|
|
42
42
|
|
|
43
43
|
## NextRec近期进展
|
|
44
|
-
|
|
44
|
+
- **01/01/2026** 新年好,在v0.4.27中加入了多个多目标模型的支持:[APG](nextrec/models/multi_task/apg.py), [ESCM](nextrec/models/multi_task/escm.py), [HMoE](nextrec/models/multi_task/hmoe.py), [Cross Stitch](nextrec/models/multi_task/cross_stitch.py)
|
|
45
|
+
- **28/12/2025** 在v0.4.21中加入了对SwanLab和Wandb的支持,通过model的`fit`方法进行配置:`use_swanlab=True, swanlab_kwargs={"project": "NextRec","name":"tutorial_movielens_deepfm"},`
|
|
45
46
|
- **21/12/2025** 在v0.4.16中加入了对[GradNorm](/nextrec/loss/grad_norm.py)的支持,通过compile的`loss_weight='grad_norm'`进行配置
|
|
46
47
|
- **12/12/2025** 在v0.4.9中加入了[RQ-VAE](/nextrec/models/representation/rqvae.py)模块。配套的[数据集](/dataset/ecommerce_task.csv)和[代码](tutorials/notebooks/zh/使用RQ-VAE构建语义ID.ipynb)已经同步在仓库中
|
|
47
48
|
- **07/12/2025** 发布了NextRec CLI命令行工具,它允许用户根据配置文件进行一键训练和推理,我们提供了相关的[教程](/nextrec_cli_preset/NextRec-CLI_zh.md)和[教学代码](/nextrec_cli_preset)
|
|
48
49
|
- **03/12/2025** NextRec获得了100颗🌟!感谢大家的支持
|
|
49
50
|
- **06/12/2025** 在v0.4.1中支持了单机多卡的分布式DDP训练,并且提供了配套的[代码](tutorials/distributed)
|
|
50
|
-
- **11/11/2025** NextRec v0.1.0发布,我们提供了10余种Ranking模型,
|
|
51
|
+
- **11/11/2025** NextRec v0.1.0发布,我们提供了10余种Ranking模型,11种多任务模型和4种召回模型,以及统一的训练/日志/指标管理系统
|
|
51
52
|
|
|
52
53
|
## 架构
|
|
53
54
|
|
|
@@ -121,7 +122,7 @@ sequence_features = [
|
|
|
121
122
|
SequenceFeature(name='sequence_1', vocab_size=int(df['sequence_1'].apply(lambda x: max(x)).max() + 1), embedding_dim=16, padding_idx=0, embedding_name='sparse_0_emb'),]
|
|
122
123
|
|
|
123
124
|
mlp_params = {
|
|
124
|
-
"
|
|
125
|
+
"hidden_dims": [256, 128, 64],
|
|
125
126
|
"activation": "relu",
|
|
126
127
|
"dropout": 0.3,
|
|
127
128
|
}
|
|
@@ -130,20 +131,20 @@ model = DIN(
|
|
|
130
131
|
dense_features=dense_features,
|
|
131
132
|
sparse_features=sparse_features,
|
|
132
133
|
sequence_features=sequence_features,
|
|
134
|
+
behavior_feature_name="sequence_0",
|
|
135
|
+
candidate_feature_name="item_id",
|
|
133
136
|
mlp_params=mlp_params,
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
attention_mlp_params={
|
|
138
|
+
"hidden_dims": [80, 40],
|
|
139
|
+
"activation": "sigmoid",
|
|
140
|
+
},
|
|
136
141
|
attention_use_softmax=True,
|
|
137
|
-
target=
|
|
138
|
-
device='
|
|
139
|
-
embedding_l1_reg=1e-6,
|
|
140
|
-
embedding_l2_reg=1e-5,
|
|
141
|
-
dense_l1_reg=1e-5,
|
|
142
|
-
dense_l2_reg=1e-4,
|
|
142
|
+
target='label', # 目标变量
|
|
143
|
+
device='cpu',
|
|
143
144
|
session_id="din_tutorial", # 实验id,用于存放训练日志
|
|
144
145
|
)
|
|
145
146
|
|
|
146
|
-
#
|
|
147
|
+
# 编译模型,优化器/损失/学习率调度器统一在 compile 中设置
|
|
147
148
|
model.compile(
|
|
148
149
|
optimizer = "adam",
|
|
149
150
|
optimizer_params = {"lr": 1e-3, "weight_decay": 1e-5},
|
|
@@ -157,7 +158,13 @@ model.fit(
|
|
|
157
158
|
epochs=3,
|
|
158
159
|
batch_size=512,
|
|
159
160
|
shuffle=True,
|
|
160
|
-
user_id_column='user_id'
|
|
161
|
+
user_id_column='user_id', # 用于计算GAUC的id列
|
|
162
|
+
valid_ratio=0.2, # 自动划分验证集(可选)
|
|
163
|
+
num_workers=4, # DataLoader 并行数
|
|
164
|
+
use_wandb=False, # 启用 Wandb(可选)
|
|
165
|
+
wandb_kwargs={"project": "NextRec", "name": "din_tutorial"},
|
|
166
|
+
use_swanlab=False, # 启用 SwanLab(可选)
|
|
167
|
+
swanlab_kwargs={"project": "NextRec", "name": "din_tutorial"},
|
|
161
168
|
)
|
|
162
169
|
|
|
163
170
|
# 训练完成后进行指标评估
|
|
@@ -184,11 +191,13 @@ nextrec --mode=train --train_config=path/to/train_config.yaml
|
|
|
184
191
|
nextrec --mode=predict --predict_config=path/to/predict_config.yaml
|
|
185
192
|
```
|
|
186
193
|
|
|
187
|
-
|
|
194
|
+
预测结果固定保存到 `{checkpoint_path}/predictions/{name}.{save_data_format}`。
|
|
195
|
+
|
|
196
|
+
> 截止当前版本0.4.33,NextRec CLI支持单机训练,分布式训练相关功能尚在开发中。
|
|
188
197
|
|
|
189
198
|
## 兼容平台
|
|
190
199
|
|
|
191
|
-
当前最新版本为0.4.
|
|
200
|
+
当前最新版本为0.4.33,所有模型和测试代码均已在以下平台通过验证,如果开发者在使用中遇到兼容问题,请在issue区提出错误报告及系统版本:
|
|
192
201
|
|
|
193
202
|
| 平台 | 配置 |
|
|
194
203
|
|------|------|
|
|
@@ -201,69 +210,74 @@ nextrec --mode=predict --predict_config=path/to/predict_config.yaml
|
|
|
201
210
|
|
|
202
211
|
### 排序模型
|
|
203
212
|
|
|
204
|
-
| 模型 | 论文 |
|
|
205
|
-
|
|
206
|
-
| [FM](nextrec/models/ranking/fm.py) | Factorization
|
|
207
|
-
| [LR](nextrec/models/ranking/lr.py) | Logistic Regression |
|
|
208
|
-
| [AFM](nextrec/models/ranking/afm.py) | Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks |
|
|
209
|
-
| [FFM](nextrec/models/ranking/ffm.py) | Field-aware Factorization Machines
|
|
210
|
-
| [DeepFM](nextrec/models/ranking/deepfm.py) | DeepFM: A
|
|
211
|
-
| [Wide&Deep](nextrec/models/ranking/widedeep.py) | Wide & Deep
|
|
212
|
-
| [xDeepFM](nextrec/models/ranking/xdeepfm.py) |
|
|
213
|
-
| [FiBiNET](nextrec/models/ranking/fibinet.py) | FiBiNET: Combining
|
|
214
|
-
| [PNN](nextrec/models/ranking/pnn.py) | Product-based
|
|
215
|
-
| [AutoInt](nextrec/models/ranking/autoint.py) | AutoInt: Automatic
|
|
216
|
-
| [DCN](nextrec/models/ranking/dcn.py) | Deep &
|
|
217
|
-
| [DCN v2](nextrec/models/ranking/dcn_v2.py) | DCN V2: Improved Deep & Cross Network and Practical Lessons for Web-scale Learning to Rank Systems |
|
|
218
|
-
| [DIN](nextrec/models/ranking/din.py) | Deep
|
|
219
|
-
| [DIEN](nextrec/models/ranking/dien.py) | Deep
|
|
220
|
-
| [MaskNet](nextrec/models/ranking/masknet.py) | MaskNet: Introducing Feature-
|
|
221
|
-
| [EulerNet](nextrec/models/ranking/eulernet.py) | EulerNet: Efficient and Effective Feature Interaction Modeling with Euler's Formula |
|
|
213
|
+
| 模型 | 论文 | 状态 |
|
|
214
|
+
| ------ | ------ | ------ |
|
|
215
|
+
| [FM](nextrec/models/ranking/fm.py) | Factorization machines | 已支持 |
|
|
216
|
+
| [LR](nextrec/models/ranking/lr.py) | Applied Logistic Regression | 已支持 |
|
|
217
|
+
| [AFM](nextrec/models/ranking/afm.py) | Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks | 已支持 |
|
|
218
|
+
| [FFM](nextrec/models/ranking/ffm.py) | Field-aware Factorization Machines for CTR Prediction | 已支持 |
|
|
219
|
+
| [DeepFM](nextrec/models/ranking/deepfm.py) | DeepFM: A factorization-machine based neural network for CTR prediction | 已支持 |
|
|
220
|
+
| [Wide&Deep](nextrec/models/ranking/widedeep.py) | Wide & Deep learning for recommender systems | 已支持 |
|
|
221
|
+
| [xDeepFM](nextrec/models/ranking/xdeepfm.py) | xdeepfm: Combining explicit and implicit feature interactions for recommender systems | 已支持 |
|
|
222
|
+
| [FiBiNET](nextrec/models/ranking/fibinet.py) | FiBiNET: Combining feature importance and bilinear feature interaction for click-through rate prediction | 已支持 |
|
|
223
|
+
| [PNN](nextrec/models/ranking/pnn.py) | Product-based neural networks for user response prediction | 已支持 |
|
|
224
|
+
| [AutoInt](nextrec/models/ranking/autoint.py) | AutoInt: Automatic feature interaction learning via self-attentive neural networks | 已支持 |
|
|
225
|
+
| [DCN](nextrec/models/ranking/dcn.py) | Deep & cross network for ad click predictions | 已支持 |
|
|
226
|
+
| [DCN v2](nextrec/models/ranking/dcn_v2.py) | DCN V2: Improved Deep & Cross Network and Practical Lessons for Web-scale Learning to Rank Systems | 已支持 |
|
|
227
|
+
| [DIN](nextrec/models/ranking/din.py) | Deep interest network for click-through rate prediction | 已支持 |
|
|
228
|
+
| [DIEN](nextrec/models/ranking/dien.py) | Deep interest evolution network for click-through rate prediction | 已支持 |
|
|
229
|
+
| [MaskNet](nextrec/models/ranking/masknet.py) | MaskNet: Introducing Feature-Wise Multiplication to CTR Ranking Models by Instance-Guided Mask | 已支持 |
|
|
230
|
+
| [EulerNet](nextrec/models/ranking/eulernet.py) | EulerNet: Efficient and Effective Feature Interaction Modeling with Euler's Formula | 已支持 |
|
|
222
231
|
|
|
223
232
|
### 召回模型
|
|
224
233
|
|
|
225
|
-
| 模型 | 论文 |
|
|
226
|
-
|
|
227
|
-
| [DSSM](nextrec/models/retrieval/dssm.py) | Learning
|
|
228
|
-
| [DSSM v2](nextrec/models/retrieval/dssm_v2.py) | DSSM with pairwise
|
|
229
|
-
| [YouTube DNN](nextrec/models/retrieval/youtube_dnn.py) | Deep
|
|
230
|
-
| [MIND](nextrec/models/retrieval/mind.py) | Multi-
|
|
231
|
-
| [SDM](nextrec/models/retrieval/sdm.py) | Sequential
|
|
234
|
+
| 模型 | 论文 | 状态 |
|
|
235
|
+
| ------ | ------ | ------ |
|
|
236
|
+
| [DSSM](nextrec/models/retrieval/dssm.py) | Learning deep structured semantic models for web search using clickthrough data | 已支持 |
|
|
237
|
+
| [DSSM v2](nextrec/models/retrieval/dssm_v2.py) | DSSM v2 - DSSM with pairwise training using BPR loss | 已支持 |
|
|
238
|
+
| [YouTube DNN](nextrec/models/retrieval/youtube_dnn.py) | Deep neural networks for youtube recommendations | 已支持 |
|
|
239
|
+
| [MIND](nextrec/models/retrieval/mind.py) | Multi-interest network with dynamic routing for recommendation at Tmall | 已支持 |
|
|
240
|
+
| [SDM](nextrec/models/retrieval/sdm.py) | Sequential recommender system based on hierarchical attention networks | 已支持 |
|
|
232
241
|
|
|
233
242
|
### 序列推荐模型
|
|
234
243
|
|
|
235
|
-
| 模型 | 论文 |
|
|
236
|
-
|
|
237
|
-
| [SASRec](nextrec/models/sequential/sasrec.py) | Self-Attentive Sequential Recommendation |
|
|
238
|
-
| [HSTU](nextrec/models/sequential/hstu.py) | Actions speak louder than words: Trillion-parameter sequential transducers for generative recommendations |
|
|
244
|
+
| 模型 | 论文 | 状态 |
|
|
245
|
+
| ------ | ------ | ------ |
|
|
246
|
+
| [SASRec](nextrec/models/sequential/sasrec.py) | Self-Attentive Sequential Recommendation | 开发中 |
|
|
247
|
+
| [HSTU](nextrec/models/sequential/hstu.py) | Actions speak louder than words: Trillion-parameter sequential transducers for generative recommendations | 已支持 |
|
|
239
248
|
|
|
240
249
|
### 多任务模型
|
|
241
250
|
|
|
242
|
-
| 模型 | 论文 |
|
|
243
|
-
|
|
244
|
-
| [MMOE](nextrec/models/multi_task/mmoe.py) | Modeling Task Relationships in Multi-task Learning
|
|
245
|
-
| [PLE](nextrec/models/multi_task/ple.py) | Progressive Layered Extraction
|
|
246
|
-
| [ESMM](nextrec/models/multi_task/esmm.py) | Entire Space Multi-Task Model
|
|
247
|
-
| [ShareBottom](nextrec/models/multi_task/share_bottom.py) | Multitask Learning |
|
|
248
|
-
| [POSO](nextrec/models/multi_task/poso.py) | POSO: Personalized Cold
|
|
251
|
+
| 模型 | 论文 | 状态 |
|
|
252
|
+
| ------ | ------ | ------ |
|
|
253
|
+
| [MMOE](nextrec/models/multi_task/mmoe.py) | Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts | 已支持 |
|
|
254
|
+
| [PLE](nextrec/models/multi_task/ple.py) | Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations | 已支持 |
|
|
255
|
+
| [ESMM](nextrec/models/multi_task/esmm.py) | Entire Space Multi-Task Model: An Effective Approach for Estimating Post-Click Conversion Rate | 已支持 |
|
|
256
|
+
| [ShareBottom](nextrec/models/multi_task/share_bottom.py) | Multitask Learning | 已支持 |
|
|
257
|
+
| [POSO](nextrec/models/multi_task/poso.py) | POSO: Personalized Cold Start Modules for Large-scale Recommender Systems | 已支持 |
|
|
258
|
+
| [PEPNet](nextrec/models/multi_task/pepnet.py) | PEPNet: Parameter and Embedding Personalized Network for Infusing with Personalized Prior Information | 已支持 |
|
|
259
|
+
| [APG](nextrec/models/multi_task/apg.py) | APG: Adaptive Parameter Generation Network for Click-Through Rate Prediction | 已支持 |
|
|
260
|
+
| [CrossStitch](nextrec/models/multi_task/cross_stitch.py) | Cross-Stitch Networks for Multi-Task Learning | 已支持 |
|
|
261
|
+
| [ESCM](nextrec/models/multi_task/escm.py) | ESCM²: Entire Space Counterfactual Multi-Task Model for Post-Click Conversion Rate Estimation | 已支持 |
|
|
262
|
+
| [HMOE](nextrec/models/multi_task/hmoe.py) | Improving multi-scenario learning to rank in e-commerce by exploiting task relationships in the label space | 已支持 |
|
|
249
263
|
|
|
250
264
|
### 生成式模型
|
|
251
265
|
|
|
252
|
-
| 模型 | 论文 |
|
|
253
|
-
|
|
254
|
-
| [TIGER](nextrec/models/generative/tiger.py) | Recommender Systems with Generative Retrieval |
|
|
266
|
+
| 模型 | 论文 | 状态 |
|
|
267
|
+
| ------ | ------ | ------ |
|
|
268
|
+
| [TIGER](nextrec/models/generative/tiger.py) | Recommender Systems with Generative Retrieval | 开发中 |
|
|
255
269
|
|
|
256
270
|
### 表征模型
|
|
257
271
|
|
|
258
|
-
| 模型 | 论文 |
|
|
259
|
-
|
|
260
|
-
| [RQ-VAE](nextrec/models/representation/rqvae.py) |
|
|
261
|
-
| [BPR](nextrec/models/representation/bpr.py) | Bayesian Personalized Ranking |
|
|
262
|
-
| [MF](nextrec/models/representation/mf.py) | Matrix Factorization Techniques for Recommender Systems |
|
|
263
|
-
| [AutoRec](nextrec/models/representation/autorec.py) | AutoRec: Autoencoders Meet Collaborative Filtering |
|
|
264
|
-
| [LightGCN](nextrec/models/representation/lightgcn.py) | LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation |
|
|
265
|
-
| [S3Rec](nextrec/models/representation/s3rec.py) | S3-Rec: Self-Supervised Learning for Sequential Recommendation |
|
|
266
|
-
| [CL4SRec](nextrec/models/representation/cl4srec.py) | CL4SRec: Contrastive Learning for Sequential Recommendation |
|
|
272
|
+
| 模型 | 论文 | 状态 |
|
|
273
|
+
| ------ | ------ | ------ |
|
|
274
|
+
| [RQ-VAE](nextrec/models/representation/rqvae.py) | Autoregressive Image Generation using Residual Quantization | 已支持 |
|
|
275
|
+
| [BPR](nextrec/models/representation/bpr.py) | Bayesian Personalized Ranking | 开发中 |
|
|
276
|
+
| [MF](nextrec/models/representation/mf.py) | Matrix Factorization Techniques for Recommender Systems | 开发中 |
|
|
277
|
+
| [AutoRec](nextrec/models/representation/autorec.py) | AutoRec: Autoencoders Meet Collaborative Filtering | 开发中 |
|
|
278
|
+
| [LightGCN](nextrec/models/representation/lightgcn.py) | LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation | 开发中 |
|
|
279
|
+
| [S3Rec](nextrec/models/representation/s3rec.py) | S3-Rec: Self-Supervised Learning for Sequential Recommendation | 开发中 |
|
|
280
|
+
| [CL4SRec](nextrec/models/representation/cl4srec.py) | CL4SRec: Contrastive Learning for Sequential Recommendation | 开发中 |
|
|
267
281
|
|
|
268
282
|
---
|
|
269
283
|
|
|
@@ -325,7 +339,7 @@ NextRec 的开发受到以下优秀项目的启发:
|
|
|
325
339
|
@misc{nextrec,
|
|
326
340
|
title = {NextRec},
|
|
327
341
|
author = {Yang Zhou},
|
|
328
|
-
year = {
|
|
342
|
+
year = {2026},
|
|
329
343
|
publisher = {GitHub},
|
|
330
344
|
journal = {GitHub repository},
|
|
331
345
|
howpublished = {\url{https://github.com/zerolovesea/NextRec}},
|