From 71e59df380b31b1c2bc1107201f934e3df41f4f3 Mon Sep 17 00:00:00 2001 From: "shengquan.nian" Date: Mon, 27 Nov 2023 10:40:20 +0800 Subject: [PATCH 1/3] add ffm model --- recommendation/ctr/ffm/paddlepaddle/README.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 recommendation/ctr/ffm/paddlepaddle/README.md diff --git a/recommendation/ctr/ffm/paddlepaddle/README.md b/recommendation/ctr/ffm/paddlepaddle/README.md new file mode 100644 index 000000000..4a0e38ad3 --- /dev/null +++ b/recommendation/ctr/ffm/paddlepaddle/README.md @@ -0,0 +1,38 @@ +# Wide&Deep + +## Model description +FFM is further improved on the basis of FM, introducing the concept of category in the model, that is, field. +The features of the same field are one-hot separately, so in FFM, each one-dimensional feature learns a hidden variable for each field of the other features, which is not only related to the feature, but also to the field. +By introducing the concept of field, FFM attributes features of the same nature to the same field. + +## Step 1: Installing +``` +git clone https://github.com/PaddlePaddle/PaddleRec.git +``` + +``` +cd PaddleRec +pip3 install -r requirements.txt +``` + +## Step 2: Training +``` +cd PaddleRec + +# Download dataset +cd datasets/criteo/ +sh run.sh + + +cd models/rank/ffm +export FLAGS_cudnn_exhaustive_search=True +export FLAGS_cudnn_batchnorm_spatial_persistent=True +export CUDA_VISIBLE_DEVICES=0 +# train +python3 -u ../../../tools/trainer.py -m config_bigdata.yaml +# Eval +python3 -u ../../../tools/infer.py -m config_bigdata.yaml +``` + +## Reference +- [PaddleRec](https://github.com/PaddlePaddle/PaddleRec) -- Gitee From 837a7ab7d1e31616e7ebd80e61d56f3cf34df552 Mon Sep 17 00:00:00 2001 From: "shengquan.nian" Date: Thu, 30 Nov 2023 05:28:07 +0000 Subject: [PATCH 2/3] update recommendation/ctr/ffm/paddlepaddle/README.md. Signed-off-by: shengquan.nian --- recommendation/ctr/ffm/paddlepaddle/README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/recommendation/ctr/ffm/paddlepaddle/README.md b/recommendation/ctr/ffm/paddlepaddle/README.md index 4a0e38ad3..e391f9f22 100644 --- a/recommendation/ctr/ffm/paddlepaddle/README.md +++ b/recommendation/ctr/ffm/paddlepaddle/README.md @@ -1,4 +1,4 @@ -# Wide&Deep +# FFM ## Model description FFM is further improved on the basis of FM, introducing the concept of category in the model, that is, field. @@ -7,7 +7,7 @@ By introducing the concept of field, FFM attributes features of the same nature ## Step 1: Installing ``` -git clone https://github.com/PaddlePaddle/PaddleRec.git +git clone -b release/2.3.0 https://github.com/PaddlePaddle/PaddleRec.git ``` ``` @@ -17,14 +17,13 @@ pip3 install -r requirements.txt ## Step 2: Training ``` -cd PaddleRec # Download dataset cd datasets/criteo/ sh run.sh -cd models/rank/ffm +cd ../../models/rank/ffm export FLAGS_cudnn_exhaustive_search=True export FLAGS_cudnn_batchnorm_spatial_persistent=True export CUDA_VISIBLE_DEVICES=0 @@ -34,5 +33,12 @@ python3 -u ../../../tools/trainer.py -m config_bigdata.yaml python3 -u ../../../tools/infer.py -m config_bigdata.yaml ``` +## Result +| GPU | AUC | epoch time | +|--- |--- |--- | +| BI-V100 x1 | 0.792128| 590.94s | + + + ## Reference - [PaddleRec](https://github.com/PaddlePaddle/PaddleRec) -- Gitee From 23dc0b1c862804736f0e379764cb9c7fda9f0bdb Mon Sep 17 00:00:00 2001 From: "shengquan.nian" Date: Thu, 30 Nov 2023 06:39:36 +0000 Subject: [PATCH 3/3] update recommendation/ctr/ffm/paddlepaddle/README.md. Signed-off-by: shengquan.nian --- recommendation/ctr/ffm/paddlepaddle/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recommendation/ctr/ffm/paddlepaddle/README.md b/recommendation/ctr/ffm/paddlepaddle/README.md index e391f9f22..105672bd7 100644 --- a/recommendation/ctr/ffm/paddlepaddle/README.md +++ b/recommendation/ctr/ffm/paddlepaddle/README.md @@ -34,9 +34,9 @@ python3 -u ../../../tools/infer.py -m config_bigdata.yaml ``` ## Result -| GPU | AUC | epoch time | +| GPU | AUC | IPS | |--- |--- |--- | -| BI-V100 x1 | 0.792128| 590.94s | +| BI-V100 x1 | 0.792128| 714.42ins/s | -- Gitee