42. ple (Progressive Layered Extraction : A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations)¶
Please refer to the code: PLEIf our code is useful to you, please give it a star~
42.1. Content¶
42.2. Introduction to the Model¶
The multi-task model can improve the learning efficiency and quality of each task by learning the connections and differences of different tasks. However, the seesaw phenomenon often occurs in multi-task scenarios, that is, some tasks perform well while some tasks perform poorly. The paper 《Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations》 proposes Progressive Layered Extraction (abbreviated as PLE) to solve the seesaw phenomenon of multi-task learning.
We define the network structure of PLE in Paddlepaddle and verify the model effect on the open-source dataset Census-income Data.
The format of the data is as follows: The generated format uses commas as delimiters
0,0,73,0,0,0,0,1700.09,0,0
42.3. Operating Environment¶
PaddlePaddle>=2.0
python 2.7/3.5/3.6/3.7
os : windows/linux/macos
42.4. Quick Start¶
This article provides sample data for you to quickly experience, and it can be executed in any directory. The quick execution command in the ple model directory is as follows:
# 进入模型目录
# cd models/multitask/ple # 在任意目录均可运行
# 动态图训练
python -u ../../../tools/trainer.py -m config.yaml # 全量数据运行config_bigdata.yaml
# 动态图预测
python -u ../../../tools/infer.py -m config.yaml
# 静态图训练
python -u ../../../tools/static_trainer.py -m config.yaml # 全量数据运行config_bigdata.yaml
# 静态图预测
python -u ../../../tools/static_infer.py -m config.yaml
42.5. Model Networking¶
42.5.1. Effect Reproduction¶
In order to facilitate users to quickly run through each model, we provide sample data under each model. If you need to reproduce the effects in the readme, please follow the steps below in sequence. The indicators of the model under the full data are as follows: | Model | auc_marital | batch_size | epoch_num | Time of each epoch | | :——| :—— | :—— | :——| :—— | | PLE | 0.99 | 32 | 100 | Approximately 1 minute |
Confirm that the current directory you are in is PaddleRec/models/multitask/ple
Enter the paddlerec/datasets/census directory and execute this script. It will download the preprocessed full census dataset from the domestic source server and extract it to the specified folder.
cd ../../../datasets/census
sh run.sh
Switch back to the model directory and execute the command to run the full amount of data
cd - # 切回模型目录
# 动态图训练
python -u ../../../tools/trainer.py -m config_bigdata.yaml # 全量数据运行config_bigdata.yaml
python -u ../../../tools/infer.py -m config_bigdata.yaml # 全量数据运行config_bigdata.yaml