Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
fc724787
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fc724787
编写于
6月 10, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix windows adapter
上级
a12fe9da
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
34 deletion
+13
-34
core/reader.py
core/reader.py
+0
-1
core/utils/envs.py
core/utils/envs.py
+10
-0
models/rank/dataset/Criteo_data/get_slot_data.py
models/rank/dataset/Criteo_data/get_slot_data.py
+1
-11
models/rank/logistic_regression/data/get_slot_data.py
models/rank/logistic_regression/data/get_slot_data.py
+1
-11
models/rank/nfm/data/get_slot_data.py
models/rank/nfm/data/get_slot_data.py
+1
-11
未找到文件。
core/reader.py
浏览文件 @
fc724787
...
...
@@ -17,7 +17,6 @@ import abc
import
os
from
functools
import
reduce
import
paddle.fluid.incubate.data_generator
as
dg
import
yaml
from
paddlerec.core.utils
import
envs
...
...
core/utils/envs.py
浏览文件 @
fc724787
...
...
@@ -95,6 +95,7 @@ def set_global_envs(envs, adapter):
if
adapter
:
workspace_adapter
()
os_path_adapter
()
reader_adapter
()
def
get_global_env
(
env_name
,
default_value
=
None
,
namespace
=
None
):
...
...
@@ -141,6 +142,15 @@ def workspace_adapter():
global_envs
[
name
]
=
value
def
reader_adapter
():
if
get_platform
()
!=
"WINDOWS"
:
return
datasets
=
global_envs
.
get
(
"dataset"
)
for
dataset
in
datasets
:
dataset
[
"type"
]
=
"DataLoader"
def
pretty_print_envs
(
envs
,
header
=
None
):
spacing
=
5
max_k
=
45
...
...
models/rank/dataset/Criteo_data/get_slot_data.py
浏览文件 @
fc724787
...
...
@@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
yaml
import
os
from
paddlerec.core.reader
import
ReaderBase
from
paddlerec.core.utils
import
envs
import
paddle.fluid.incubate.data_generator
as
dg
try
:
...
...
@@ -27,12 +23,7 @@ except ImportError:
class
Reader
(
dg
.
MultiSlotDataGenerator
):
def
__init__
(
self
,
config
):
dg
.
MultiSlotDataGenerator
.
__init__
(
self
)
if
os
.
path
.
isfile
(
config
):
with
open
(
config
,
'r'
)
as
rb
:
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
else
:
raise
ValueError
(
"reader config only support yaml"
)
_config
=
envs
.
load_yaml
(
config
)
def
init
(
self
):
self
.
cont_min_
=
[
0
,
-
3
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
...
...
@@ -87,7 +78,6 @@ class Reader(dg.MultiSlotDataGenerator):
v
=
i
[
1
]
for
j
in
v
:
s
+=
" "
+
k
+
":"
+
str
(
j
)
print
s
.
strip
()
yield
None
return
data_iter
...
...
models/rank/logistic_regression/data/get_slot_data.py
浏览文件 @
fc724787
...
...
@@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
yaml
import
os
from
paddlerec.core.reader
import
ReaderBase
from
paddlerec.core.utils
import
envs
import
paddle.fluid.incubate.data_generator
as
dg
...
...
@@ -28,12 +24,7 @@ except ImportError:
class
Reader
(
dg
.
MultiSlotDataGenerator
):
def
__init__
(
self
,
config
):
dg
.
MultiSlotDataGenerator
.
__init__
(
self
)
if
os
.
path
.
isfile
(
config
):
with
open
(
config
,
'r'
)
as
rb
:
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
else
:
raise
ValueError
(
"reader config only support yaml"
)
_config
=
envs
.
load_yaml
(
config
)
def
init
(
self
):
self
.
cont_min_
=
[
0
,
-
3
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
...
...
@@ -88,7 +79,6 @@ class Reader(dg.MultiSlotDataGenerator):
v
=
i
[
1
]
for
j
in
v
:
s
+=
" "
+
k
+
":"
+
str
(
j
)
print
s
.
strip
()
yield
None
return
data_iter
...
...
models/rank/nfm/data/get_slot_data.py
浏览文件 @
fc724787
...
...
@@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
yaml
import
os
from
paddlerec.core.reader
import
ReaderBase
from
paddlerec.core.utils
import
envs
import
paddle.fluid.incubate.data_generator
as
dg
try
:
...
...
@@ -27,12 +23,7 @@ except ImportError:
class
Reader
(
dg
.
MultiSlotDataGenerator
):
def
__init__
(
self
,
config
):
dg
.
MultiSlotDataGenerator
.
__init__
(
self
)
if
os
.
path
.
isfile
(
config
):
with
open
(
config
,
'r'
)
as
rb
:
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
else
:
raise
ValueError
(
"reader config only support yaml"
)
_config
=
envs
.
load_yaml
(
config
)
def
init
(
self
):
self
.
cont_min_
=
[
0
,
-
3
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
...
...
@@ -87,7 +78,6 @@ class Reader(dg.MultiSlotDataGenerator):
v
=
i
[
1
]
for
j
in
v
:
s
+=
" "
+
k
+
":"
+
str
(
j
)
print
s
.
strip
()
yield
None
return
data_iter
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录