Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a13798e8
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a13798e8
编写于
8月 22, 2017
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename add_op to append_op
上级
d41a5516
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
python/paddle/v2/framework/tests/mnist.py
python/paddle/v2/framework/tests/mnist.py
+6
-6
未找到文件。
python/paddle/v2/framework/tests/mnist.py
浏览文件 @
a13798e8
...
@@ -60,7 +60,7 @@ def sgd_optimizer(net, param_name, learning_rate=0.01):
...
@@ -60,7 +60,7 @@ def sgd_optimizer(net, param_name, learning_rate=0.01):
grad
=
grad_name
,
grad
=
grad_name
,
param_out
=
param_name
,
param_out
=
param_name
,
learning_rate
=
learning_rate
)
learning_rate
=
learning_rate
)
net
.
a
d
d_op
(
optimize_op
)
net
.
a
ppen
d_op
(
optimize_op
)
# should use operator and add these to the init_network
# should use operator and add these to the init_network
...
@@ -102,7 +102,7 @@ def fc_layer(net, input, size, act="softmax", bias=True, param=None, name=None):
...
@@ -102,7 +102,7 @@ def fc_layer(net, input, size, act="softmax", bias=True, param=None, name=None):
pre_activation
=
name
+
".mul.out"
pre_activation
=
name
+
".mul.out"
scope
.
new_var
(
pre_activation
)
scope
.
new_var
(
pre_activation
)
mul_op
=
Operator
(
"mul"
,
X
=
input
,
Y
=
w_name
,
Out
=
pre_activation
)
mul_op
=
Operator
(
"mul"
,
X
=
input
,
Y
=
w_name
,
Out
=
pre_activation
)
net
.
a
d
d_op
(
mul_op
)
net
.
a
ppen
d_op
(
mul_op
)
# create bias variable if needed
# create bias variable if needed
if
bias
:
if
bias
:
...
@@ -112,13 +112,13 @@ def fc_layer(net, input, size, act="softmax", bias=True, param=None, name=None):
...
@@ -112,13 +112,13 @@ def fc_layer(net, input, size, act="softmax", bias=True, param=None, name=None):
net
=
optimize_net
,
param_name
=
bias_name
,
learning_rate
=
0.01
)
net
=
optimize_net
,
param_name
=
bias_name
,
learning_rate
=
0.01
)
bias_out
=
name
+
".rowwise_add.out"
bias_out
=
name
+
".rowwise_add.out"
scope
.
new_var
(
bias_out
)
scope
.
new_var
(
bias_out
)
rowwise_a
d
d_op
=
Operator
(
rowwise_a
ppen
d_op
=
Operator
(
"rowwise_add"
,
X
=
pre_activation
,
b
=
bias_name
,
Out
=
bias_out
)
"rowwise_add"
,
X
=
pre_activation
,
b
=
bias_name
,
Out
=
bias_out
)
net
.
a
dd_op
(
rowwise_ad
d_op
)
net
.
a
ppend_op
(
rowwise_appen
d_op
)
pre_activation
=
bias_out
pre_activation
=
bias_out
activation_op
=
Operator
(
act
,
X
=
pre_activation
,
Y
=
name
)
activation_op
=
Operator
(
act
,
X
=
pre_activation
,
Y
=
name
)
net
.
a
d
d_op
(
activation_op
)
net
.
a
ppen
d_op
(
activation_op
)
scope
.
new_var
(
name
)
scope
.
new_var
(
name
)
net
.
infer_shape
(
scope
)
net
.
infer_shape
(
scope
)
return
name
return
name
...
@@ -128,7 +128,7 @@ def cross_entropy_layer(net, input, label):
...
@@ -128,7 +128,7 @@ def cross_entropy_layer(net, input, label):
cost_name
=
'cross_entropy_%d'
%
uniq_id
()
cost_name
=
'cross_entropy_%d'
%
uniq_id
()
cross_entropy_op
=
Operator
(
cross_entropy_op
=
Operator
(
"onehot_cross_entropy"
,
X
=
input
,
label
=
label
,
Y
=
cost_name
)
"onehot_cross_entropy"
,
X
=
input
,
label
=
label
,
Y
=
cost_name
)
net
.
a
d
d_op
(
cross_entropy_op
)
net
.
a
ppen
d_op
(
cross_entropy_op
)
scope
.
new_var
(
cost_name
)
scope
.
new_var
(
cost_name
)
net
.
infer_shape
(
scope
)
net
.
infer_shape
(
scope
)
return
cost_name
return
cost_name
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录