Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
33fc1750
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
33fc1750
编写于
5月 13, 2020
作者:
C
chengmo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add reader debug mode
上级
013c12ff
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
14 deletion
+17
-14
core/trainers/transpiler_trainer.py
core/trainers/transpiler_trainer.py
+11
-11
models/rank/dnn/config.yaml
models/rank/dnn/config.yaml
+1
-1
models/recall/tdm/config.yaml
models/recall/tdm/config.yaml
+1
-0
models/recall/tdm/tdm_evaluate_reader.py
models/recall/tdm/tdm_evaluate_reader.py
+2
-1
models/recall/tdm/tdm_reader.py
models/recall/tdm/tdm_reader.py
+2
-1
未找到文件。
core/trainers/transpiler_trainer.py
浏览文件 @
33fc1750
...
...
@@ -42,7 +42,7 @@ class TranspileTrainer(Trainer):
namespace
=
"train.reader"
class_name
=
"TrainReader"
else
:
dataloader
=
self
.
model
.
_infer_data_loader
reader
dataloader
=
self
.
model
.
_infer_data_loader
namespace
=
"evaluate.reader"
class_name
=
"EvaluateReader"
...
...
@@ -52,22 +52,22 @@ class TranspileTrainer(Trainer):
reader
=
dataloader_instance
.
dataloader
(
reader_class
,
state
,
self
.
_config_yaml
)
debug_mode
=
envs
.
get_global_env
(
"debug_mode"
,
False
,
namespace
)
reader_class
=
envs
.
lazy_instance_by_fliename
(
reader_class
,
class_name
)
reader_ins
=
reader_class
(
self
.
_config_yaml
)
if
hasattr
(
reader_ins
,
'generate_batch_from_trainfiles'
):
dataloader
.
set_sample_list_generator
(
reader
)
else
:
dataloader
.
set_sample_generator
(
reader
,
batch_size
)
debug_mode
=
envs
.
get_global_env
(
"reader_debug_mode"
,
False
,
namespace
)
if
debug_mode
:
print
(
"--- DataLoader Debug Mode Begin , show pre 10 data ---"
)
for
idx
,
line
in
enumerate
(
reader
):
for
idx
,
line
in
enumerate
(
reader
()
):
print
(
line
)
if
idx
>=
9
:
break
print
(
"--- DataLoader Debug Mode End , show pre 10 data ---"
)
exit
(
0
)
reader_class
=
envs
.
lazy_instance_by_fliename
(
reader_class
,
class_name
)
reader_ins
=
reader_class
(
self
.
_config_yaml
)
if
hasattr
(
reader_ins
,
'generate_batch_from_trainfiles'
):
dataloader
.
set_sample_list_generator
(
reader
)
else
:
dataloader
.
set_sample_generator
(
reader
,
batch_size
)
return
dataloader
def
_get_dataset
(
self
,
state
=
"TRAIN"
):
...
...
@@ -109,7 +109,7 @@ class TranspileTrainer(Trainer):
dataset
.
set_filelist
(
file_list
)
debug_mode
=
envs
.
get_global_env
(
"debug_mode"
,
False
,
namespace
)
debug_mode
=
envs
.
get_global_env
(
"
reader_
debug_mode"
,
False
,
namespace
)
if
debug_mode
:
print
(
"--- Dataset Debug Mode Begin , show pre 10 data of {}---"
.
format
(
file_list
[
0
]))
...
...
models/rank/dnn/config.yaml
浏览文件 @
33fc1750
...
...
@@ -24,7 +24,7 @@ train:
batch_size
:
2
class
:
"
{workspace}/../criteo_reader.py"
train_data_path
:
"
{workspace}/data/train"
debug_mode
:
False
reader_
debug_mode
:
False
model
:
models
:
"
{workspace}/model.py"
...
...
models/recall/tdm/config.yaml
浏览文件 @
33fc1750
...
...
@@ -25,6 +25,7 @@ train:
class
:
"
{workspace}/tdm_reader.py"
train_data_path
:
"
{workspace}/data/train"
test_data_path
:
"
{workspace}/data/test"
reader_debug_mode
:
False
model
:
models
:
"
{workspace}/model.py"
...
...
models/recall/tdm/tdm_evaluate_reader.py
浏览文件 @
33fc1750
...
...
@@ -33,7 +33,8 @@ class EvaluateReader(Reader):
This function needs to be implemented by the user, based on data format
"""
features
=
(
line
.
strip
(
'
\n
'
)).
split
(
'
\t
'
)
input_emb
=
map
(
float
,
features
[
0
].
split
(
' '
))
input_emb
=
features
[
0
].
split
(
' '
)
input_emb
=
[
float
(
i
)
for
i
in
input_emb
]
feature_name
=
[
"input_emb"
]
yield
zip
(
feature_name
,
[
input_emb
])
...
...
models/recall/tdm/tdm_reader.py
浏览文件 @
33fc1750
...
...
@@ -33,7 +33,8 @@ class TrainReader(Reader):
This function needs to be implemented by the user, based on data format
"""
features
=
(
line
.
strip
(
'
\n
'
)).
split
(
'
\t
'
)
input_emb
=
map
(
float
,
features
[
0
].
split
(
' '
))
input_emb
=
features
[
0
].
split
(
' '
)
input_emb
=
[
float
(
i
)
for
i
in
input_emb
]
item_label
=
[
int
(
features
[
1
])]
feature_name
=
[
"input_emb"
,
"item_label"
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录