Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a8612adb
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a8612adb
编写于
12月 26, 2018
作者:
Y
Yancey1989
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix lr scale test=develop
上级
86bb5838
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
17 deletion
+13
-17
python/paddle/fluid/tests/unittests/test_parallel_executor_seresnext.py
...fluid/tests/unittests/test_parallel_executor_seresnext.py
+13
-17
未找到文件。
python/paddle/fluid/tests/unittests/test_parallel_executor_seresnext.py
浏览文件 @
a8612adb
...
@@ -167,17 +167,13 @@ def cosine_decay(learning_rate, step_each_epoch, epochs=120):
...
@@ -167,17 +167,13 @@ def cosine_decay(learning_rate, step_each_epoch, epochs=120):
return
decayed_lr
return
decayed_lr
def
optimizer
(
learning_rate
=
0.01
,
lr_scale
=
1.0
):
def
optimizer
(
learning_rate
=
0.01
):
def
_opt
():
optimizer
=
fluid
.
optimizer
.
Momentum
(
return
fluid
.
optimizer
.
Momentum
(
learning_rate
=
cosine_decay
(
learning_rate
=
cosine_decay
(
learning_rate
=
learning_rate
/
lr_scale
,
learning_rate
=
learning_rate
,
step_each_epoch
=
2
,
epochs
=
1
),
step_each_epoch
=
2
,
epochs
=
1
),
momentum
=
0.9
,
momentum
=
0.9
,
regularization
=
fluid
.
regularizer
.
L2Decay
(
1e-4
))
regularization
=
fluid
.
regularizer
.
L2Decay
(
1e-4
))
return
optimizer
return
_opt
class
TestResnet
(
TestParallelExecutorBase
):
class
TestResnet
(
TestParallelExecutorBase
):
...
@@ -220,7 +216,7 @@ class TestResnet(TestParallelExecutorBase):
...
@@ -220,7 +216,7 @@ class TestResnet(TestParallelExecutorBase):
batch_size
=
batch_size
,
batch_size
=
batch_size
,
use_cuda
=
use_cuda
,
use_cuda
=
use_cuda
,
use_reduce
=
False
,
use_reduce
=
False
,
optimizer
=
optimizer
()
)
optimizer
=
optimizer
)
reduce_first_loss
,
reduce_last_loss
=
self
.
check_network_convergence
(
reduce_first_loss
,
reduce_last_loss
=
self
.
check_network_convergence
(
model
,
model
,
feed_dict
=
{
"image"
:
img
,
feed_dict
=
{
"image"
:
img
,
...
@@ -229,7 +225,7 @@ class TestResnet(TestParallelExecutorBase):
...
@@ -229,7 +225,7 @@ class TestResnet(TestParallelExecutorBase):
batch_size
=
batch_size
,
batch_size
=
batch_size
,
use_cuda
=
use_cuda
,
use_cuda
=
use_cuda
,
use_reduce
=
True
,
use_reduce
=
True
,
optimizer
=
optimizer
()
)
optimizer
=
optimizer
)
for
loss
in
zip
(
all_reduce_first_loss
,
reduce_first_loss
):
for
loss
in
zip
(
all_reduce_first_loss
,
reduce_first_loss
):
self
.
assertAlmostEquals
(
loss
[
0
],
loss
[
1
],
delta
=
1e-6
)
self
.
assertAlmostEquals
(
loss
[
0
],
loss
[
1
],
delta
=
1e-6
)
...
@@ -247,7 +243,7 @@ class TestResnet(TestParallelExecutorBase):
...
@@ -247,7 +243,7 @@ class TestResnet(TestParallelExecutorBase):
batch_size
=
batch_size
,
batch_size
=
batch_size
,
use_cuda
=
use_cuda
,
use_cuda
=
use_cuda
,
use_reduce
=
False
,
use_reduce
=
False
,
optimizer
=
optimizer
()
,
optimizer
=
optimizer
,
enable_sequential_execution
=
True
)
enable_sequential_execution
=
True
)
reduce_first_loss_seq
,
reduce_last_loss_seq
=
self
.
check_network_convergence
(
reduce_first_loss_seq
,
reduce_last_loss_seq
=
self
.
check_network_convergence
(
...
@@ -258,7 +254,7 @@ class TestResnet(TestParallelExecutorBase):
...
@@ -258,7 +254,7 @@ class TestResnet(TestParallelExecutorBase):
batch_size
=
batch_size
,
batch_size
=
batch_size
,
use_cuda
=
use_cuda
,
use_cuda
=
use_cuda
,
use_reduce
=
True
,
use_reduce
=
True
,
optimizer
=
optimizer
()
,
optimizer
=
optimizer
,
enable_sequential_execution
=
True
)
enable_sequential_execution
=
True
)
for
loss
in
zip
(
all_reduce_first_loss
,
all_reduce_first_loss_seq
):
for
loss
in
zip
(
all_reduce_first_loss
,
all_reduce_first_loss_seq
):
...
@@ -301,7 +297,7 @@ class TestResnet(TestParallelExecutorBase):
...
@@ -301,7 +297,7 @@ class TestResnet(TestParallelExecutorBase):
batch_size
=
batch_size
,
batch_size
=
batch_size
,
use_cuda
=
use_cuda
,
use_cuda
=
use_cuda
,
use_reduce
=
use_reduce
,
use_reduce
=
use_reduce
,
optimizer
=
optimizer
()
,
optimizer
=
optimizer
,
use_parallel_executor
=
False
,
use_parallel_executor
=
False
,
use_parallel_graph
=
use_parallel_graph
)
use_parallel_graph
=
use_parallel_graph
)
parallel_first_loss
,
parallel_last_loss
=
self
.
check_network_convergence
(
parallel_first_loss
,
parallel_last_loss
=
self
.
check_network_convergence
(
...
@@ -312,7 +308,7 @@ class TestResnet(TestParallelExecutorBase):
...
@@ -312,7 +308,7 @@ class TestResnet(TestParallelExecutorBase):
batch_size
=
batch_size
,
batch_size
=
batch_size
,
use_cuda
=
use_cuda
,
use_cuda
=
use_cuda
,
use_reduce
=
use_reduce
,
use_reduce
=
use_reduce
,
optimizer
=
optimizer
()
,
optimizer
=
optimizer
,
use_parallel_graph
=
use_parallel_graph
)
use_parallel_graph
=
use_parallel_graph
)
self
.
assertAlmostEquals
(
self
.
assertAlmostEquals
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录