Skip to content

Commit 35288ae

Browse files
authored
Add multitask models:SharedBottom, ESSM, MMOE, PLE
- add multitask learning models:SharedBottom, ESSM, MMOE, PLE - set `dnn_hidden_units` parameter to `(256, 128, 64)` - add new package `deepctr.models.multitask` and `deepctr.models.sequence` - fix truncated feature value error when padding string sequence in run_multivalue_movielens_hash.py
2 parents 9f15559 + 1cbcb45 commit 35288ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1406
-360
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Steps to reproduce the behavior:
2020
**Operating environment(运行环境):**
2121
- python version [e.g. 3.6, 3.7]
2222
- tensorflow version [e.g. 1.4.0, 1.15.0, 2.5.0]
23-
- deepctr version [e.g. 0.8.6,]
23+
- deepctr version [e.g. 0.9.0,]
2424

2525
**Additional context**
2626
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ Add any other context about the problem here.
1717
**Operating environment(运行环境):**
1818
- python version [e.g. 3.6]
1919
- tensorflow version [e.g. 1.4.0, 1.15.0, 2.5.0]
20-
- deepctr version [e.g. 0.8.6,]
20+
- deepctr version [e.g. 0.9.0,]

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
python-version: [3.6,3.7]
21-
tf-version: [1.4.0,1.15.0,2.1.0,2.5.0]
21+
tf-version: [1.4.0,1.15.0,2.2.0,2.5.0]
2222

2323
exclude:
2424
- python-version: 3.7
@@ -28,10 +28,10 @@ jobs:
2828

2929
steps:
3030

31-
- uses: actions/checkout@v1
31+
- uses: actions/checkout@v2
3232

3333
- name: Setup python environment
34-
uses: actions/setup-python@v1
34+
uses: actions/setup-python@v2.2.2
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737

@@ -49,7 +49,7 @@ jobs:
4949
pip install -q python-coveralls
5050
pytest --cov=deepctr --cov-report=xml
5151
- name: Upload coverage to Codecov
52-
uses: codecov/codecov-action@v1.0.2
52+
uses: codecov/codecov-action@v2.0.3
5353
with:
5454
token: ${{secrets.CODECOV_TOKEN}}
5555
file: ./coverage.xml

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@
1818
<!-- [![Gitter](https://badges.gitter.im/DeepCTR/community.svg)](https://gitter.im/DeepCTR/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -->
1919

2020

21-
DeepCTR is a **Easy-to-use**,**Modular** and **Extendible** package of deep-learning based CTR models along with lots of core components layers which can be used to easily build custom models.You can use any complex model with `model.fit()`,and `model.predict()` .
22-
23-
- Provide `tf.keras.Model` like interface for **quick experiment**. [example](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html#getting-started-4-steps-to-deepctr)
24-
- Provide `tensorflow estimator` interface for **large scale data** and **distributed training**. [example](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html#getting-started-4-steps-to-deepctr-estimator-with-tfrecord)
21+
DeepCTR is a **Easy-to-use**,**Modular** and **Extendible** package of deep-learning based CTR models along with lots of
22+
core components layers which can be used to easily build custom models.You can use any complex model with `model.fit()`
23+
,and `model.predict()` .
24+
25+
- Provide `tf.keras.Model` like interface for **quick experiment**
26+
. [example](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html#getting-started-4-steps-to-deepctr)
27+
- Provide `tensorflow estimator` interface for **large scale data** and **distributed training**
28+
. [example](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html#getting-started-4-steps-to-deepctr-estimator-with-tfrecord)
2529
- It is compatible with both `tf 1.x` and `tf 2.x`.
2630

2731
Some related projects:
32+
2833
- DeepMatch: https://github.com/shenweichen/DeepMatch
2934
- DeepCTR-Torch: https://github.com/shenweichen/DeepCTR-Torch
3035

31-
32-
Let's [**Get Started!**](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html)([Chinese Introduction](https://zhuanlan.zhihu.com/p/53231955)) and [welcome to join us!](./CONTRIBUTING.md)
36+
Let's [**Get Started!**](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html)([Chinese
37+
Introduction](https://zhuanlan.zhihu.com/p/53231955)) and [welcome to join us!](./CONTRIBUTING.md)
3338

3439
## Models List
3540

@@ -45,8 +50,8 @@ Let's [**Get Started!**](https://deepctr-doc.readthedocs.io/en/latest/Quick-Star
4550
| Attentional Factorization Machine | [IJCAI 2017][Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks](http://www.ijcai.org/proceedings/2017/435) |
4651
| Neural Factorization Machine | [SIGIR 2017][Neural Factorization Machines for Sparse Predictive Analytics](https://arxiv.org/pdf/1708.05027.pdf) |
4752
| xDeepFM | [KDD 2018][xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems](https://arxiv.org/pdf/1803.05170.pdf) |
48-
| Deep Interest Network | [KDD 2018][Deep Interest Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1706.06978.pdf)
49-
| AutoInt | [CIKM 2019][AutoInt: Automatic Feature Interaction Learning via Self-Attentive Neural Networks](https://arxiv.org/abs/1810.11921) ||
53+
| Deep Interest Network | [KDD 2018][Deep Interest Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1706.06978.pdf) |
54+
| AutoInt | [CIKM 2019][AutoInt: Automatic Feature Interaction Learning via Self-Attentive Neural Networks](https://arxiv.org/abs/1810.11921) |
5055
| Deep Interest Evolution Network | [AAAI 2019][Deep Interest Evolution Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1809.03672.pdf) |
5156
| FwFM | [WWW 2018][Field-weighted Factorization Machines for Click-Through Rate Prediction in Display Advertising](https://arxiv.org/pdf/1806.03514.pdf) |
5257
| ONN | [arxiv 2019][Operation-aware Neural Networks for User Response Prediction](https://arxiv.org/pdf/1904.12579.pdf) |
@@ -59,11 +64,15 @@ Let's [**Get Started!**](https://deepctr-doc.readthedocs.io/en/latest/Quick-Star
5964
| DCN V2 | [arxiv 2020][DCN V2: Improved Deep & Cross Network and Practical Lessons for Web-scale Learning to Rank Systems](https://arxiv.org/abs/2008.13535) |
6065
| DIFM | [IJCAI 2020][A Dual Input-aware Factorization Machine for CTR Prediction](https://www.ijcai.org/Proceedings/2020/0434.pdf) |
6166
| FEFM and DeepFEFM | [arxiv 2020][Field-Embedded Factorization Machines for Click-through rate prediction](https://arxiv.org/abs/2009.09931) |
67+
| SharedBottom | [arxiv 2017][An Overview of Multi-Task Learning in Deep Neural Networks](https://arxiv.org/pdf/1706.05098.pdf) |
68+
| ESMM | [SIGIR 2018][Entire Space Multi-Task Model: An Effective Approach for Estimating Post-Click Conversion Rate](https://arxiv.org/abs/1804.07931) |
69+
| MMOE | [KDD 2018][Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts](https://dl.acm.org/doi/abs/10.1145/3219819.3220007) |
70+
| PLE | [RecSys 2020][Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations](https://dl.acm.org/doi/10.1145/3383313.3412236) |
6271

6372
## Citation
6473

65-
- Weichen Shen. (2017). DeepCTR: Easy-to-use,Modular and Extendible package of deep-learning based CTR models. https://github.com/shenweichen/deepctr.
66-
74+
- Weichen Shen. (2017). DeepCTR: Easy-to-use,Modular and Extendible package of deep-learning based CTR
75+
models. https://github.com/shenweichen/deepctr.
6776

6877
If you find this code useful in your research, please cite it using the following BibTeX:
6978

@@ -81,11 +90,10 @@ If you find this code useful in your research, please cite it using the followin
8190
## DisscussionGroup
8291

8392
- [Discussions](https://github.com/shenweichen/DeepCTR/discussions)
84-
- 公众号:**浅梦学习笔记**
85-
- wechat ID: **deepctrbot**
93+
- 公众号:**浅梦学习笔记**
94+
- wechat ID: **deepctrbot**
8695

8796
![wechat](./docs/pics/code.png)
88-
8997

9098
## Main contributors([welcome to join us!](./CONTRIBUTING.md))
9199

@@ -108,6 +116,11 @@ If you find this code useful in your research, please cite it using the followin
108116
​ <a href="https://github.com/pandeconscious">Harshit Pande</a>
109117
<p> Amazon </p>​
110118
</td>
119+
<td>
120+
​ <a href="https://github.com/morningsky"><img width="70" height="70" src="https://github.com/morningsky.png?s=40" alt="pic"></a><br>
121+
​ <a href="https://github.com/morningsky">Lai Mincai</a>
122+
<p> ShanghaiTech University </p>​
123+
</td>
111124
<td>
112125
​ <a href="https://github.com/codewithzichao"><img width="70" height="70" src="https://github.com/codewithzichao.png?s=40" alt="pic"></a><br>
113126
​ <a href="https://github.com/codewithzichao">Li Zichao</a>

deepctr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .utils import check_version
22

3-
__version__ = '0.8.7'
3+
__version__ = '0.9.0'
44
check_version(__version__)

deepctr/estimator/feature_column.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ def input_from_feature_columns(features, feature_columns, l2_reg_embedding=0.0):
4747
def is_embedding(feature_column):
4848
try:
4949
from tensorflow.python.feature_column.feature_column_v2 import EmbeddingColumn
50-
except:
50+
except ImportError:
5151
EmbeddingColumn = _EmbeddingColumn
5252
return isinstance(feature_column, (_EmbeddingColumn, EmbeddingColumn))

deepctr/estimator/models/autoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
def AutoIntEstimator(linear_feature_columns, dnn_feature_columns, att_layer_num=3, att_embedding_size=8, att_head_num=2,
2222
att_res=True,
23-
dnn_hidden_units=(256, 256), dnn_activation='relu', l2_reg_linear=1e-5,
23+
dnn_hidden_units=(256, 128, 64), dnn_activation='relu', l2_reg_linear=1e-5,
2424
l2_reg_embedding=1e-5, l2_reg_dnn=0, dnn_use_bn=False, dnn_dropout=0, seed=1024,
2525
task='binary', model_dir=None, config=None, linear_optimizer='Ftrl',
2626
dnn_optimizer='Adagrad', training_chief_hooks=None):

deepctr/estimator/models/ccpm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def CCPMEstimator(linear_feature_columns, dnn_feature_columns, conv_kernel_width=(6, 5), conv_filters=(4, 4),
22-
dnn_hidden_units=(256,), l2_reg_linear=1e-5, l2_reg_embedding=1e-5, l2_reg_dnn=0, dnn_dropout=0,
22+
dnn_hidden_units=(128, 64), l2_reg_linear=1e-5, l2_reg_embedding=1e-5, l2_reg_dnn=0, dnn_dropout=0,
2323
seed=1024, task='binary', model_dir=None, config=None, linear_optimizer='Ftrl',
2424
dnn_optimizer='Adagrad', training_chief_hooks=None):
2525
"""Instantiates the Convolutional Click Prediction Model architecture.

deepctr/estimator/models/dcn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from ...layers.utils import combined_dnn_input
1616

1717

18-
def DCNEstimator(linear_feature_columns, dnn_feature_columns, cross_num=2, dnn_hidden_units=(128, 128,),
18+
def DCNEstimator(linear_feature_columns, dnn_feature_columns, cross_num=2, dnn_hidden_units=(256, 128, 64),
1919
l2_reg_linear=1e-5,
2020
l2_reg_embedding=1e-5,
2121
l2_reg_cross=1e-5, l2_reg_dnn=0, seed=1024, dnn_dropout=0, dnn_use_bn=False,

deepctr/estimator/models/deepfefm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def DeepFEFMEstimator(linear_feature_columns, dnn_feature_columns,
22-
dnn_hidden_units=(128, 128), l2_reg_linear=0.00001, l2_reg_embedding_feat=0.00001,
22+
dnn_hidden_units=(256, 128, 64), l2_reg_linear=0.00001, l2_reg_embedding_feat=0.00001,
2323
l2_reg_embedding_field=0.00001, l2_reg_dnn=0, seed=1024, dnn_dropout=0.0,
2424
dnn_activation='relu', dnn_use_bn=False, task='binary', model_dir=None,
2525
config=None, linear_optimizer='Ftrl', dnn_optimizer='Adagrad', training_chief_hooks=None):

0 commit comments

Comments
 (0)