Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_40195168达庆意
keras
提交
ee4b0bcc
K
keras
项目概览
weixin_40195168达庆意
/
keras
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
keras
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ee4b0bcc
编写于
10月 31, 2017
作者:
O
Oleg Zabluda
提交者:
François Chollet
10月 31, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve synchronized shuffle in datasets (#8325)
* Improve synchronized shuffle * pep8
上级
de17ff3b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
15 deletion
+17
-15
keras/datasets/boston_housing.py
keras/datasets/boston_housing.py
+4
-3
keras/datasets/imdb.py
keras/datasets/imdb.py
+9
-9
keras/datasets/reuters.py
keras/datasets/reuters.py
+4
-3
未找到文件。
keras/datasets/boston_housing.py
浏览文件 @
ee4b0bcc
...
...
@@ -25,9 +25,10 @@ def load_data(path='boston_housing.npz', test_split=0.2, seed=113):
f
.
close
()
np
.
random
.
seed
(
seed
)
np
.
random
.
shuffle
(
x
)
np
.
random
.
seed
(
seed
)
np
.
random
.
shuffle
(
y
)
indices
=
np
.
arange
(
len
(
x
))
np
.
random
.
shuffle
(
indices
)
x
=
x
[
indices
]
y
=
y
[
indices
]
x_train
=
np
.
array
(
x
[:
int
(
len
(
x
)
*
(
1
-
test_split
))])
y_train
=
np
.
array
(
y
[:
int
(
len
(
x
)
*
(
1
-
test_split
))])
...
...
keras/datasets/imdb.py
浏览文件 @
ee4b0bcc
...
...
@@ -55,15 +55,15 @@ def load_data(path='imdb.npz', num_words=None, skip_top=0,
x_train
,
labels_train
=
f
[
'x_train'
],
f
[
'y_train'
]
x_test
,
labels_test
=
f
[
'x_test'
],
f
[
'y_test'
]
np
.
random
.
seed
(
seed
)
np
.
random
.
shuffle
(
x_train
)
np
.
random
.
seed
(
seed
)
np
.
random
.
shuffle
(
labels_train
)
np
.
random
.
seed
(
seed
*
2
)
np
.
random
.
shuffle
(
x_test
)
np
.
random
.
seed
(
seed
*
2
)
np
.
random
.
shuffle
(
labels_test
)
indices
=
np
.
arange
(
len
(
x_train
)
)
np
.
random
.
shuffle
(
indices
)
x_train
=
x_train
[
indices
]
labels_train
=
labels_train
[
indices
]
indices
=
np
.
arange
(
len
(
x_test
)
)
np
.
random
.
shuffle
(
indices
)
x_test
=
x_test
[
indices
]
labels_test
=
labels_test
[
indices
]
xs
=
np
.
concatenate
([
x_train
,
x_test
])
labels
=
np
.
concatenate
([
labels_train
,
labels_test
])
...
...
keras/datasets/reuters.py
浏览文件 @
ee4b0bcc
...
...
@@ -53,9 +53,10 @@ def load_data(path='reuters.npz', num_words=None, skip_top=0,
xs
,
labels
=
f
[
'x'
],
f
[
'y'
]
np
.
random
.
seed
(
seed
)
np
.
random
.
shuffle
(
xs
)
np
.
random
.
seed
(
seed
)
np
.
random
.
shuffle
(
labels
)
indices
=
np
.
arange
(
len
(
xs
))
np
.
random
.
shuffle
(
indices
)
xs
=
xs
[
indices
]
labels
=
labels
[
indices
]
if
start_char
is
not
None
:
xs
=
[[
start_char
]
+
[
w
+
index_from
for
w
in
x
]
for
x
in
xs
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录