Skip to content

Commit ed78604

Browse files
authored
Merge branch 'master' into fat_fix
2 parents 260f6db + 7a4c419 commit ed78604

File tree

16 files changed

+50
-31
lines changed

16 files changed

+50
-31
lines changed

datasets/Avazu_flen/data_config.yaml

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

1515

1616
runner:
17-
raw_file_dir: "path" # raw_data dir
17+
raw_file_dir: "raw_file/train" # raw_data dir
1818
raw_filled_file_dir: "./raw_data" # raw_data_filled dir
1919
train_data_dir: "./train_data_full" # train datasets
2020
test_data_dir: "./test_data_full" # test datasets

datasets/Avazu_flen/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, config):
5959
self.min_threshold = self.config.get("runner.min_threshold")
6060
self.feature_map_cache = self.config.get("runner.feature_map_cache")
6161

62-
# self.filled_raw()
62+
self.filled_raw()
6363

6464
self.init()
6565

datasets/Avazu_flen/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#### 1.Get raw datasets:
33
you can go to:[https://www.kaggle.com/c/avazu-ctr-prediction/data](https://www.kaggle.com/c/avazu-ctr-prediction)
44

5-
将下载的原始数据目录配置在data_config.yaml中,执行命令获取全量数据
5+
将下载的数据解压后,只保留训练集即可,且命名为`train``
66

77
| 名称 | 说明 |
88
| -------- | -------- |
9-
| raw_file_dir | 原始数据集目录 |
9+
| raw_file | 原始数据集目录 |
1010
| raw_filled_file_dir | 原始数据缺失值处理后的目录 |
1111
| train_data_dir | 训练集存放目录 |
1212
| test_data_dir | 测试集存放目录 |
@@ -15,9 +15,9 @@ you can go to:[https://www.kaggle.com/c/avazu-ctr-prediction/data](https://www
1515
| feature_map_cache | 特征缓存数据 |
1616

1717

18-
18+
然后执行脚本
1919
```bash
20-
sh data_process.sh
20+
sh run.sh
2121
```
2222
#### 2.Get preprocessd datasets:
2323
you can also go to: [AiStudio数据集](https://aistudio.baidu.com/aistudio/datasetdetail/125200)

datasets/Avazu_flen/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
mkdir train_data_full
2+
mkdir test_data_full
3+
mkdir raw_file
4+
mkdir raw_filled_file_dir
5+
mv train ./raw_file
6+
17
python preprocess.py -m data_config.yaml

models/rank/autofis/readme.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55
```
66
├── data #样例数据
77
├── sample_data #样例数据
8-
├── train
9-
├── train_x.npy #训练数据样例
10-
├── train_y.npy #训练数据样例
8+
├── sample_train_x.txt #训练数据样例
9+
├── sample_train_y.txt #训练数据样例
1110
├── __init__.py
12-
├── README.md #文档
1311
├── config.yaml # sample数据配置
1412
├── config_bigdata.yaml # 全量数据配置
15-
├── net.py # 模型核心组网
1613
├── criteo_reader.py #数据读取程序
1714
├── dygraph_model.py # 构建动态图
15+
├── metrics.py # 自定义评估指标
16+
├── net.py # 模型核心组网
17+
├── optimizer.py # 自定义优化器
1818
├── trainer.py # 训练脚本
19+
├── README.md #文档
20+
├── trainer.py #训练入口
1921
```
2022

2123
注:在阅读该示例前,建议您先了解以下内容:
@@ -54,7 +56,7 @@ os : windows/linux/macos
5456
# cd models/rank/autofis # 在任意目录均可运行
5557
# 动态图训练
5658
python trainer.py -m config.yaml # stage0:自动搜索最佳特征组合 全量数据运行config_bigdata.yaml
57-
python trainer.py -m config.yaml -o stage=1 # stage1:训练最终模 全量数据运行config_bigdata.yaml型
59+
python trainer.py -m config.yaml -o stage=1 # stage1:训练最终模型 全量数据运行config_bigdata.yaml
5860

5961
# 动态图预测
6062
python -u ../../../tools/infer.py -m config.yaml -o stage=1 # 全量数据运行config_bigdata.yaml

models/rank/dcn/net.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def __init__(self, sparse_feature_number, sparse_feature_dim,
8888
if acts[i] == 'relu':
8989
act = paddle.nn.ReLU()
9090
self.add_sublayer('act_%d' % i, act)
91+
self._mlp_layers.append(act)
9192

9293
self.fc = paddle.nn.Linear(
9394
in_features=self.layer_sizes[-1] + self.sparse_num_field *

models/rank/dcn_v2/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
```
66
├── data # 样例数据
7-
├── sample_data # 样例数据
8-
├── train
9-
├── sample_train.txt # 训练数据样例
7+
├── sample_train.txt # 训练数据样例
108
├── __init__.py
119
├── README.md # 文档
1210
├── config.yaml # sample数据配置

models/rank/dcn_v2/net.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def __init__(self,
169169
if acts[i] == 'relu':
170170
act = paddle.nn.ReLU()
171171
self.add_sublayer('act_%d' % i, act)
172+
self._mlp_layers.append(act)
172173

173174
def forward(self, feat_embeddings):
174175
# y_dnn = paddle.reshape(feat_embeddings,[feat_embeddings.shape[0], -1])

models/rank/deepfefm/net.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def __init__(self,
224224
if acts[i] == 'relu':
225225
act = paddle.nn.ReLU()
226226
self.add_sublayer('act_%d' % i, act)
227+
self._mlp_layers.append(act)
227228

228229
def forward(self, feat_embeddings):
229230
y_dnn = paddle.reshape(feat_embeddings, [-1, self.input_size])

models/rank/deepfm/net.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def __init__(self, sparse_feature_number, sparse_feature_dim,
164164
if acts[i] == 'relu':
165165
act = paddle.nn.ReLU()
166166
self.add_sublayer('act_%d' % i, act)
167+
self._mlp_layers.append(act)
167168

168169
def forward(self, feat_embeddings):
169170
y_dnn = paddle.reshape(feat_embeddings,

0 commit comments

Comments
 (0)