Skip to content

Commit 2705f05

Browse files
authored
bug fix (#134)
1 parent 8fe1d05 commit 2705f05

19 files changed

+104
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.h5
22
*.ipynb
33
.pytest_cache/
4+
.vscode/
45
tests/unused/*
56
# Byte-compiled / optimized / DLL files
67
__pycache__/

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ install:
5151
- pip install -q codacy-coverage
5252
- pip install -q tensorflow==$TF_VERSION
5353
- pip install -q pandas
54+
- pip install -q packaging
5455
- pip install -e .
5556
# command to run tests
5657
script:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2017-2019 Weichen Shen
189+
Copyright 2017-present Weichen Shen
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# DeepCTR
22

33
[![Python Versions](https://img.shields.io/pypi/pyversions/deepctr.svg)](https://pypi.org/project/deepctr)
4+
[![TensorFlow Versions](https://img.shields.io/badge/TensorFlow-1.4+/2.0+-blue.svg)](https://pypi.org/project/deepctr)
45
[![Downloads](https://pepy.tech/badge/deepctr)](https://pepy.tech/project/deepctr)
56
[![PyPI Version](https://img.shields.io/pypi/v/deepctr.svg)](https://pypi.org/project/deepctr)
67
[![GitHub Issues](https://img.shields.io/github/issues/shenweichen/deepctr.svg
78
)](https://github.com/shenweichen/deepctr/issues)
8-
[![Activity](https://img.shields.io/github/last-commit/shenweichen/deepctr.svg)](https://github.com/shenweichen/DeepCTR/commits/master)
9+
<!-- [![Activity](https://img.shields.io/github/last-commit/shenweichen/deepctr.svg)](https://github.com/shenweichen/DeepCTR/commits/master) -->
910

1011

1112
[![Documentation Status](https://readthedocs.org/projects/deepctr-doc/badge/?version=latest)](https://deepctr-doc.readthedocs.io/)
1213
[![Build Status](https://travis-ci.org/shenweichen/DeepCTR.svg?branch=master)](https://travis-ci.org/shenweichen/DeepCTR)
1314
[![Coverage Status](https://coveralls.io/repos/github/shenweichen/DeepCTR/badge.svg?branch=master)](https://coveralls.io/github/shenweichen/DeepCTR?branch=master)
1415
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d4099734dc0e4bab91d332ead8c0bdd0)](https://www.codacy.com/app/wcshen1994/DeepCTR?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=shenweichen/DeepCTR&amp;utm_campaign=Badge_Grade)
16+
[![Gitter](https://badges.gitter.im/DeepCTR/community.svg)](https://gitter.im/DeepCTR/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1517
[![License](https://img.shields.io/github/license/shenweichen/deepctr.svg)](https://github.com/shenweichen/deepctr/blob/master/LICENSE)
1618

17-
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 build your own custom model easily.It is implemented by tensorflow.You can use any complex model with `model.fit()`and `model.predict()` .
19+
20+
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 build your own custom model easily.It is compatible with **tensorflow 1.4+ and 2.0+**.You can use any complex model with `model.fit()`and `model.predict()` .
1821

1922
Let's [**Get Started!**](https://deepctr-doc.readthedocs.io/en/latest/Quick-Start.html)([Chinese Introduction](https://zhuanlan.zhihu.com/p/53231955))
2023

deepctr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
from . import models
33
from .utils import check_version
44

5-
__version__ = '0.6.0'
5+
__version__ = '0.6.1'
66
check_version(__version__)

deepctr/models/ccpm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def CCPM(linear_feature_columns, dnn_feature_columns, embedding_size=8, conv_ker
4545
features = build_input_features(linear_feature_columns+dnn_feature_columns)
4646
inputs_list = list(features.values())
4747

48-
sparse_embedding_list, _ = input_from_feature_columns(features,linear_feature_columns,embedding_size,
48+
sparse_embedding_list, _ = input_from_feature_columns(features,dnn_feature_columns,embedding_size,
4949
l2_reg_embedding, init_std,
5050
seed,support_dense=False)
5151
linear_logit = get_linear_logit(features, linear_feature_columns, l2_reg=l2_reg_linear, init_std=init_std,

deepctr/models/dien.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def interest_evolution(concat_behavior, deep_input_item, user_behavior_length, g
103103
if gru_type not in ["GRU", "AIGRU", "AGRU", "AUGRU"]:
104104
raise ValueError("gru_type error ")
105105
aux_loss_1 = None
106-
107-
rnn_outputs = DynamicGRU(embedding_size * 2, return_sequence=True,
106+
embedding_size = None
107+
rnn_outputs = DynamicGRU(embedding_size, return_sequence=True,
108108
name="gru1")([concat_behavior, user_behavior_length])
109109

110110
if gru_type == "AUGRU" and use_neg:
@@ -115,7 +115,7 @@ def interest_evolution(concat_behavior, deep_input_item, user_behavior_length, g
115115
tf.subtract(user_behavior_length, 1), stag="gru") # [:, 1:]
116116

117117
if gru_type == "GRU":
118-
rnn_outputs2 = DynamicGRU(embedding_size * 2, return_sequence=True,
118+
rnn_outputs2 = DynamicGRU(embedding_size, return_sequence=True,
119119
name="gru2")([rnn_outputs, user_behavior_length])
120120
# attention_score = AttentionSequencePoolingLayer(hidden_size=att_hidden_size, activation=att_activation, weight_normalization=att_weight_normalization, return_score=True)([
121121
# deep_input_item, rnn_outputs2, user_behavior_length])
@@ -134,10 +134,10 @@ def interest_evolution(concat_behavior, deep_input_item, user_behavior_length, g
134134

135135
if gru_type == "AIGRU":
136136
hist = multiply([rnn_outputs, Permute([2, 1])(scores)])
137-
final_state2 = DynamicGRU(embedding_size * 2, gru_type="GRU", return_sequence=False, name='gru2')(
137+
final_state2 = DynamicGRU(embedding_size, gru_type="GRU", return_sequence=False, name='gru2')(
138138
[hist, user_behavior_length])
139139
else: # AGRU AUGRU
140-
final_state2 = DynamicGRU(embedding_size * 2, gru_type=gru_type, return_sequence=False,
140+
final_state2 = DynamicGRU(embedding_size, gru_type=gru_type, return_sequence=False,
141141
name='gru2')([rnn_outputs, user_behavior_length, Permute([2, 1])(scores)])
142142
hist = final_state2
143143
return hist, aux_loss_1

docs/source/FAQ.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ just install deepctr with
112112
$ pip install deepctr[gpu]
113113
```
114114

115-
## 7. Could not find a version that satisfies the requirement deepctr (from versions)
116-
please install with `pip3 install` instead of `pip install`
115+
## 7. How to run the demo with multiple GPUs
116+
you can use multiple gpus with tensorflow version higher than ``1.4``,see [run_classification_criteo_multi_gpu.py](https://github.com/shenweichen/DeepCTR/blob/master/examples/run_classification_criteo_multi_gpu.py)

docs/source/History.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# History
2+
- 09/07/2019 : [v0.6.1](https://github.com/shenweichen/DeepCTR/releases/tag/v0.6.1) released.Fix bugs in `CCPM` and `DynamicGRU`.
23
- 08/02/2019 : [v0.6.0](https://github.com/shenweichen/DeepCTR/releases/tag/v0.6.0) released.Now DeepCTR is compatible with tensorflow `1.14` and `2.0.0`.
34
- 07/21/2019 : [v0.5.2](https://github.com/shenweichen/DeepCTR/releases/tag/v0.5.2) released.Refactor `Linear` Layer.
45
- 07/10/2019 : [v0.5.1](https://github.com/shenweichen/DeepCTR/releases/tag/v0.5.1) released.Add [FiBiNET](./Features.html#fibinet-feature-importance-and-bilinear-feature-interaction-network).

docs/source/Quick-Start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Quick-Start
22

33
## Installation Guide
4-
Now `deepctr` is available for python `2.7 `and `3.4, 3.5, 3.6`.
4+
Now `deepctr` is available for python `2.7 `and `3.5, 3.6, 3.7`.
55
`deepctr` depends on tensorflow, you can specify to install the cpu version or gpu version through `pip`.
66

77
### CPU version
@@ -57,7 +57,7 @@ Usually there are two simple way to encode the sparse categorical feature for em
5757
lbe = HashEncoder()
5858
data[feat] = lbe.transform(data[feat])
5959
```
60-
- Do feature hashing on the flay in training process
60+
- Do feature hashing on the fly in training process
6161

6262
We can do feature hasing throug setting `use_hash=True` in `SparseFeat` or `VarlenSparseFeat` in Step3.
6363

0 commit comments

Comments
 (0)