From bb6e5db848224aa2fea57e9eb6fe30c4f35af886 Mon Sep 17 00:00:00 2001 From: yaoxuefeng Date: Mon, 1 Jun 2020 15:43:55 +0800 Subject: [PATCH] fix codes and readme --- models/rank/din/model.py | 6 ------ models/rank/readme.md | 3 +-- models/rank/xdeepfm/config.yaml | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/models/rank/din/model.py b/models/rank/din/model.py index 9be8f9e7..7f3d4801 100755 --- a/models/rank/din/model.py +++ b/models/rank/din/model.py @@ -69,12 +69,6 @@ class Model(ModelBase): name="target_cat_seq", shape=[None, seq_len], dtype="int64") self.data_var.append(target_cat_seq) - #if self.use_DataLoader: - # self._data_loader = fluid.io.DataLoader.from_generator( - # feed_list=self.data_var, - # capacity=10000, - # use_double_buffer=False, - # iterable=False) train_inputs = [hist_item_seq] + [hist_cat_seq] + [target_item] + [ target_cat ] + [label] + [mask] + [target_item_seq] + [target_cat_seq] diff --git a/models/rank/readme.md b/models/rank/readme.md index e6819476..7d79f389 100755 --- a/models/rank/readme.md +++ b/models/rank/readme.md @@ -59,7 +59,6 @@ ## 使用教程(快速开始) 使用样例数据快速开始,参考[训练](###训练) & [预测](###预测) ## 使用教程(复现论文) -### 注意 为了方便使用者能够快速的跑通每一个模型,我们在每个模型下都提供了样例数据,并且调整了batch_size等超参以便在样例数据上更加友好的显示训练&测试日志。如果需要复现readme中的效果请按照如下表格调整batch_size等超参,并使用提供的脚本下载对应数据集以及数据预处理。 | 模型 | batch_size | thread_num | epoch_num | | :------------------: | :--------------------: | :--------------------: | :--------------------: | @@ -89,7 +88,7 @@ python -m paddlerec.run -m ./config.yaml # 自定义修改超参后,指定配 # 修改对应模型的config.yaml,mode配置infer_runner # 示例: mode: runner1 -> mode: infer_runner # infer_runner中 class配置为 class: single_infer -# 如果训练阶段和预测阶段的模型输入一直phase不需要改动,复用train的即可 +# 如果训练阶段和预测阶段的模型输入一致,phase不需要改动,复用train的即可 # 修改完config.yaml后 执行: python -m paddlerec.run -m ./config.yaml # 以DNN为例 diff --git a/models/rank/xdeepfm/config.yaml b/models/rank/xdeepfm/config.yaml index 3e576111..6274d585 100755 --- a/models/rank/xdeepfm/config.yaml +++ b/models/rank/xdeepfm/config.yaml @@ -16,13 +16,13 @@ workspace: "paddlerec.models.rank.xdeepfm" dataset: - name: sample_1 - type: QueueDataset #或者QueueDataset + type: QueueDataset #或者DataLoader batch_size: 5 data_path: "{workspace}/data/sample_data/train" sparse_slots: "label feat_idx" dense_slots: "feat_value:39" - name: infer_sample - type: QueueDataset #或者QueueDataset + type: QueueDataset #或者DataLoader batch_size: 5 data_path: "{workspace}/data/sample_data/train" sparse_slots: "label feat_idx" -- GitLab