Skip to content

Commit

Permalink
fix error in dcn-mix (#152)
Browse files Browse the repository at this point in the history
fix error in dcn-mix
  • Loading branch information
浅梦 authored Feb 12, 2021
1 parent e7d5215 commit d18ea26
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 28 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ If you
- have spare time to learn and develop
- familiar with git

please send a brief introduction of your background and experience to wcshen1994@163.com, welcome to join us!
please send a brief introduction of your background and experience to weichenswc@163.com, welcome to join us!

# Creating a pull request
1. **Become a collaborator**: Send an email with introduction and your github account name to wcshen1994@163.com and waiting for invitation to become a collaborator.
1. **Become a collaborator**: Send an email with introduction and your github account name to weichenswc@163.com and waiting for invitation to become a collaborator.
2. **Fork&Dev**: Fork your own branch(`dev_yourname`) in `DeepCTR-Torch` from the `master` branch for development.If the `master` is updated during the development process, remember to merge and update to `dev_yourname` regularly.
3. **Testing**: Test logical correctness and effect when finishing the code development of the `dev_yourname` branch.
4. **Pre-release** : After testing contact wcshen1994@163.com for pre-release integration, usually your branch `dev_yourname` will be merged into `release` branch by squash merge.
4. **Pre-release** : After testing contact weichenswc@163.com for pre-release integration, usually your branch `dev_yourname` will be merged into `release` branch by squash merge.
5. **Release a new version**: After confirming that the change is no longer needed, `release` branch will be merged into `master` and a new python package will be released on pypi.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Let's [**Get Started!**](https://deepctr-torch.readthedocs.io/en/latest/Quick-St
| AutoInt | [CIKM 2019][AutoInt: Automatic Feature Interaction Learning via Self-Attentive Neural Networks](https://arxiv.org/abs/1810.11921) |
| ONN | [arxiv 2019][Operation-aware Neural Networks for User Response Prediction](https://arxiv.org/pdf/1904.12579.pdf) |
| FiBiNET | [RecSys 2019][FiBiNET: Combining Feature Importance and Bilinear feature Interaction for Click-Through Rate Prediction](https://arxiv.org/pdf/1905.09433.pdf) |
| DCN-M | [arxiv 2020][DCN-M: Improved Deep & Cross Network for Feature Cross Learning in Web-scale Learning to Rank Systems](https://arxiv.org/abs/2008.13535) |
| 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) |


## DisscussionGroup & Related Projects
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from . import models
from .utils import check_version

__version__ = '0.2.4'
__version__ = '0.2.5'
check_version(__version__)
2 changes: 1 addition & 1 deletion deepctr_torch/inputs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
"""

from collections import OrderedDict, namedtuple, defaultdict
Expand Down
12 changes: 5 additions & 7 deletions deepctr_torch/layers/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,13 @@ def forward(self, inputs):
if self.parameterization == 'vector':
xl_w = torch.tensordot(x_l, self.kernels[i], dims=([1], [0]))
dot_ = torch.matmul(x_0, xl_w)
x_l = dot_ + self.bias[i]
x_l = dot_ + self.bias[i] + x_l
elif self.parameterization == 'matrix':
dot_ = torch.matmul(self.kernels[i], x_l) # W * xi (bs, in_features, 1)
dot_ = dot_ + self.bias[i] # W * xi + b
dot_ = x_0 * dot_ # x0 · (W * xi + b) Hadamard-product
xl_w = torch.matmul(self.kernels[i], x_l) # W * xi (bs, in_features, 1)
dot_ = xl_w + self.bias[i] # W * xi + b
x_l = x_0 * dot_ + x_l # x0 · (W * xi + b) +xl Hadamard-product
else: # error
print("parameterization should be 'vector' or 'matrix'")
pass
x_l = dot_ + x_l
raise ValueError("parameterization should be 'vector' or 'matrix'")
x_l = torch.squeeze(x_l, dim=2)
return x_l

Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/layers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
"""
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/afm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] Xiao J, Ye H, He X, et al. Attentional factorization machines: Learning the weight of feature interactions via attention networks[J]. arXiv preprint arXiv:1708.04617, 2017.
(https://arxiv.org/abs/1708.04617)
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/autoint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] Song W, Shi C, Xiao Z, et al. AutoInt: Automatic Feature Interaction Learning via Self-Attentive Neural Networks[J]. arXiv preprint arXiv:1810.11921, 2018.(https://arxiv.org/abs/1810.11921)
"""
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
"""
from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/deepfm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] Guo H, Tang R, Ye Y, et al. Deepfm: a factorization-machine based neural network for ctr prediction[J]. arXiv preprint arXiv:1703.04247, 2017.(https://arxiv.org/abs/1703.04247)
"""
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/mlr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Author:
Wutong Zhang
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] Gai K, Zhu X, Li H, et al. Learning Piece-wise Linear Models from Large Scale Data for Ad Click Prediction[J]. arXiv preprint arXiv:1704.05194, 2017.(https://arxiv.org/abs/1704.05194)
"""
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/nfm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] He X, Chua T S. Neural factorization machines for sparse predictive analytics[C]//Proceedings of the 40th International ACM SIGIR conference on Research and Development in Information Retrieval. ACM, 2017: 355-364. (https://arxiv.org/abs/1708.05027)
"""
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/pnn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] Qu Y, Cai H, Ren K, et al. Product-based neural networks for user response prediction[C]//Data Mining (ICDM), 2016 IEEE 16th International Conference on. IEEE, 2016: 1149-1154.(https://arxiv.org/pdf/1611.00144.pdf)
"""
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/models/wdl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
Reference:
[1] Cheng H T, Koc L, Harmsen J, et al. Wide & deep learning for recommender systems[C]//Proceedings of the 1st Workshop on Deep Learning for Recommender Systems. ACM, 2016: 7-10.(https://arxiv.org/pdf/1606.07792.pdf)
"""
Expand Down
2 changes: 1 addition & 1 deletion deepctr_torch/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Weichen Shen,weichenswc@163.com
"""

import json
Expand Down
1 change: 1 addition & 0 deletions docs/source/History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# History
- 02/12/2021 : [v0.2.5](https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.5) released.Fix bug in DCN-M.
- 12/05/2020 : [v0.2.4](https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.4) released.Imporve compatibility & fix issues.Add History callback.([example](https://deepctr-torch.readthedocs.io/en/latest/FAQ.html#set-learning-rate-and-use-earlystopping)).
- 10/18/2020 : [v0.2.3](https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.3) released.Add [DCN-M](./Features.html#dcn-deep-cross-network)&[DCN-Mix](./Features.html#dcn-mix-improved-deep-cross-network-with-mix-of-experts-and-matrix-kernel).Add EarlyStopping and ModelCheckpoint callbacks([example](https://deepctr-torch.readthedocs.io/en/latest/FAQ.html#set-learning-rate-and-use-earlystopping)).
- 10/09/2020 : [v0.2.2](https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.2) released.Improve the reproducibility & fix some bugs.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.2.4'
release = '0.2.5'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ You can read the latest code at https://github.com/shenweichen/DeepCTR-Torch and

News
-----
02/12/2021 : Fix bug in DCN-M. `Changelog <https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.4>`_

12/05/2020 : Imporve compatibility & fix issues.Add History callback(`example <https://deepctr-torch.readthedocs.io/en/latest/FAQ.html#set-learning-rate-and-use-earlystopping>`_). `Changelog <https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.3>`_

10/18/2020 : Add `DCN-M <./Features.html#dcn-deep-cross-network>`_ and `DCN-Mix <./Features.html#dcn-mix-improved-deep-cross-network-with-mix-of-experts-and-matrix-kernel>`_ . Add EarlyStopping and ModelCheckpoint callbacks(`example <https://deepctr-torch.readthedocs.io/en/latest/FAQ.html#set-learning-rate-and-use-earlystopping>`_). `Changelog <https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.3>`_

10/09/2020 : Improve the reproducibility & fix some bugs. `Changelog <https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.2>`_


DisscussionGroup
-----------------------
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

setuptools.setup(
name="deepctr-torch",
version="0.2.4",
version="0.2.5",
author="Weichen Shen",
author_email="wcshen1994@163.com",
author_email="weichenswc@163.com",
description="Easy-to-use,Modular and Extendible package of deep learning based CTR(Click Through Rate) prediction models with PyTorch",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit d18ea26

Please sign in to comment.