Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
fb7c787d
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看板
提交
fb7c787d
编写于
3月 29, 2019
作者:
M
minqiyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix conflicts
test=develop
上级
3e579812
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
python/paddle/fluid/dygraph/learning_rate_scheduler.py
python/paddle/fluid/dygraph/learning_rate_scheduler.py
+0
-0
python/paddle/fluid/layers/learning_rate_scheduler.py
python/paddle/fluid/layers/learning_rate_scheduler.py
+3
-3
python/paddle/fluid/tests/unittests/test_imperative_mnist.py
python/paddle/fluid/tests/unittests/test_imperative_mnist.py
+5
-5
未找到文件。
python/paddle/fluid/
imperative
/learning_rate_scheduler.py
→
python/paddle/fluid/
dygraph
/learning_rate_scheduler.py
浏览文件 @
fb7c787d
文件已移动
python/paddle/fluid/layers/learning_rate_scheduler.py
浏览文件 @
fb7c787d
...
@@ -30,8 +30,8 @@ from . import ops
...
@@ -30,8 +30,8 @@ from . import ops
from
.
import
tensor
from
.
import
tensor
from
..initializer
import
init_on_cpu
from
..initializer
import
init_on_cpu
from
..framework
import
default_main_program
,
Parameter
,
unique_name
,
name_scope
from
..framework
import
default_main_program
,
Parameter
,
unique_name
,
name_scope
from
..
imperative
import
base
as
imperative_base
from
..
dygraph
import
base
as
imperative_base
from
..
imperative
import
learning_rate_scheduler
as
imperate_lr
from
..
dygraph
import
learning_rate_scheduler
as
imperate_lr
__all__
=
[
__all__
=
[
'exponential_decay'
,
'natural_exp_decay'
,
'inverse_time_decay'
,
'exponential_decay'
,
'natural_exp_decay'
,
'inverse_time_decay'
,
...
@@ -350,7 +350,7 @@ def cosine_decay(learning_rate, step_each_epoch, epochs):
...
@@ -350,7 +350,7 @@ def cosine_decay(learning_rate, step_each_epoch, epochs):
following cosine decay strategy.
following cosine decay strategy.
decayed_lr = learning_rate * 0.5 * (math.cos(epoch * math.pi / epochs) + 1)
decayed_lr = learning_rate * 0.5 * (math.cos(epoch * math.pi / epochs) + 1)
Args:
Args:
learning_rate(Variable|float): The initial learning rate.
learning_rate(Variable|float): The initial learning rate.
step_each_epoch(int): the number of steps in an epoch.
step_each_epoch(int): the number of steps in an epoch.
...
...
python/paddle/fluid/tests/unittests/test_imperative_mnist.py
浏览文件 @
fb7c787d
...
@@ -23,12 +23,12 @@ import paddle
...
@@ -23,12 +23,12 @@ import paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
paddle.fluid
import
core
from
paddle.fluid
import
core
from
paddle.fluid.optimizer
import
SGDOptimizer
from
paddle.fluid.optimizer
import
SGDOptimizer
from
paddle.fluid.
imperative
.nn
import
Conv2D
,
Pool2D
,
FC
from
paddle.fluid.
dygraph
.nn
import
Conv2D
,
Pool2D
,
FC
from
paddle.fluid.
imperative
.base
import
to_variable
from
paddle.fluid.
dygraph
.base
import
to_variable
from
test_imperative_base
import
new_program_scope
from
test_imperative_base
import
new_program_scope
class
SimpleImgConvPool
(
fluid
.
imperative
.
Layer
):
class
SimpleImgConvPool
(
fluid
.
dygraph
.
Layer
):
def
__init__
(
self
,
def
__init__
(
self
,
name_scope
,
name_scope
,
num_channels
,
num_channels
,
...
@@ -77,7 +77,7 @@ class SimpleImgConvPool(fluid.imperative.Layer):
...
@@ -77,7 +77,7 @@ class SimpleImgConvPool(fluid.imperative.Layer):
return
x
return
x
class
MNIST
(
fluid
.
imperative
.
Layer
):
class
MNIST
(
fluid
.
dygraph
.
Layer
):
def
__init__
(
self
,
name_scope
):
def
__init__
(
self
,
name_scope
):
super
(
MNIST
,
self
).
__init__
(
name_scope
)
super
(
MNIST
,
self
).
__init__
(
name_scope
)
...
@@ -108,7 +108,7 @@ class TestImperativeMnist(unittest.TestCase):
...
@@ -108,7 +108,7 @@ class TestImperativeMnist(unittest.TestCase):
def
test_mnist_float32
(
self
):
def
test_mnist_float32
(
self
):
seed
=
90
seed
=
90
epoch_num
=
1
epoch_num
=
1
with
fluid
.
imperative
.
guard
():
with
fluid
.
dygraph
.
guard
():
fluid
.
default_startup_program
().
random_seed
=
seed
fluid
.
default_startup_program
().
random_seed
=
seed
fluid
.
default_main_program
().
random_seed
=
seed
fluid
.
default_main_program
().
random_seed
=
seed
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录