Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleFL
提交
1a581da8
P
PaddleFL
项目概览
PaddlePaddle
/
PaddleFL
通知
35
Star
5
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
6
列表
看板
标记
里程碑
合并请求
4
Wiki
3
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleFL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
6
Issue
6
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
3
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1a581da8
编写于
12月 16, 2019
作者:
Q
qjing666
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
7d9ce164
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
2 deletion
+1
-2
paddle_fl/dataset/femnist.py
paddle_fl/dataset/femnist.py
+1
-1
paddle_fl/examples/femnist_demo/fl_trainer.py
paddle_fl/examples/femnist_demo/fl_trainer.py
+0
-1
未找到文件。
paddle_fl/dataset/femnist.py
浏览文件 @
1a581da8
...
@@ -34,7 +34,7 @@ def train(trainer_id,inner_step,batch_size,count_by_step):
...
@@ -34,7 +34,7 @@ def train(trainer_id,inner_step,batch_size,count_by_step):
rand
=
random
.
randrange
(
0
,
len
(
users
))
# random choose a user from each trainer
rand
=
random
.
randrange
(
0
,
len
(
users
))
# random choose a user from each trainer
cur_user
=
users
[
rand
]
cur_user
=
users
[
rand
]
print
(
'training using '
+
cur_user
)
print
(
'training using '
+
cur_user
)
train_images
=
json_train
[
"user_data"
][
cur_user
][
'x'
]
train_images
=
json_train
[
"user_data"
][
cur_user
][
'x'
]
train_labels
=
json_train
[
"user_data"
][
cur_user
][
'y'
]
train_labels
=
json_train
[
"user_data"
][
cur_user
][
'y'
]
if
count_by_step
:
if
count_by_step
:
for
i
in
xrange
(
inner_step
*
batch_size
):
for
i
in
xrange
(
inner_step
*
batch_size
):
...
...
paddle_fl/examples/femnist_demo/fl_trainer.py
浏览文件 @
1a581da8
...
@@ -61,7 +61,6 @@ while not trainer.stop():
...
@@ -61,7 +61,6 @@ while not trainer.stop():
test_reader
=
paddle
.
batch
(
test_reader
=
paddle
.
batch
(
paddle_fl
.
dataset
.
femnist
.
test
(
trainer_id
,
inner_step
=
trainer
.
_step
,
batch_size
=
64
,
count_by_step
=
count_by_step
),
batch_size
=
64
)
paddle_fl
.
dataset
.
femnist
.
test
(
trainer_id
,
inner_step
=
trainer
.
_step
,
batch_size
=
64
,
count_by_step
=
count_by_step
),
batch_size
=
64
)
if
count_by_step
:
if
count_by_step
:
for
step_id
,
data
in
enumerate
(
train_reader
()):
for
step_id
,
data
in
enumerate
(
train_reader
()):
acc
=
trainer
.
run
(
feeder
.
feed
(
data
),
fetch
=
[
"accuracy_0.tmp_0"
])
acc
=
trainer
.
run
(
feeder
.
feed
(
data
),
fetch
=
[
"accuracy_0.tmp_0"
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录