Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
303d2663
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
303d2663
编写于
6月 01, 2017
作者:
E
emailweixu
提交者:
GitHub
6月 01, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2340 from emailweixu/boot_bias_layer
Fix handling of boot_bias_parameter for recurrent_group in v2 API
上级
c562e576
02a509f1
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
6 deletion
+14
-6
python/paddle/v2/layer.py
python/paddle/v2/layer.py
+14
-6
未找到文件。
python/paddle/v2/layer.py
浏览文件 @
303d2663
...
@@ -152,7 +152,7 @@ def __get_used_layers__(output_layers, extra_layers=None):
...
@@ -152,7 +152,7 @@ def __get_used_layers__(output_layers, extra_layers=None):
return
layer_names
return
layer_names
def
__get_used_parameters__
(
layer_names
):
def
__get_used_parameters__
(
layer_names
,
sub_models
):
parameter_names
=
set
()
parameter_names
=
set
()
for
name
in
layer_names
:
for
name
in
layer_names
:
l
=
cp
.
g_layer_map
[
name
]
l
=
cp
.
g_layer_map
[
name
]
...
@@ -161,6 +161,12 @@ def __get_used_parameters__(layer_names):
...
@@ -161,6 +161,12 @@ def __get_used_parameters__(layer_names):
parameter_names
.
add
(
inp
.
input_parameter_name
)
parameter_names
.
add
(
inp
.
input_parameter_name
)
if
l
.
bias_parameter_name
:
if
l
.
bias_parameter_name
:
parameter_names
.
add
(
l
.
bias_parameter_name
)
parameter_names
.
add
(
l
.
bias_parameter_name
)
for
sub_model
in
sub_models
:
for
mem
in
sub_model
.
memories
:
if
mem
.
HasField
(
"boot_bias_parameter_name"
):
parameter_names
.
add
(
mem
.
boot_bias_parameter_name
)
return
parameter_names
return
parameter_names
...
@@ -236,7 +242,6 @@ def parse_network(output_layers, extra_layers=None):
...
@@ -236,7 +242,6 @@ def parse_network(output_layers, extra_layers=None):
layer_names
=
__get_used_layers__
(
output_layers
+
extra_layers
)
layer_names
=
__get_used_layers__
(
output_layers
+
extra_layers
)
submodel_names
=
__get_used_submodels__
(
layer_names
)
submodel_names
=
__get_used_submodels__
(
layer_names
)
submodel_names
.
add
(
'root'
)
submodel_names
.
add
(
'root'
)
parameter_names
=
__get_used_parameters__
(
layer_names
)
evaluator_names
=
__get_used_evaluators__
(
layer_names
)
evaluator_names
=
__get_used_evaluators__
(
layer_names
)
input_layer_names
=
set
()
input_layer_names
=
set
()
output_layer_names
=
set
()
output_layer_names
=
set
()
...
@@ -251,10 +256,6 @@ def parse_network(output_layers, extra_layers=None):
...
@@ -251,10 +256,6 @@ def parse_network(output_layers, extra_layers=None):
model_config
.
input_layer_names
.
append
(
l
.
name
)
model_config
.
input_layer_names
.
append
(
l
.
name
)
input_layer_names
.
add
(
l
.
name
)
input_layer_names
.
add
(
l
.
name
)
for
p
in
cp
.
g_config
.
model_config
.
parameters
:
if
p
.
name
in
parameter_names
:
model_config
.
parameters
.
extend
([
p
])
for
layer
in
output_layers
:
for
layer
in
output_layers
:
model_config
.
output_layer_names
.
append
(
layer
.
full_name
)
model_config
.
output_layer_names
.
append
(
layer
.
full_name
)
output_layer_names
.
add
(
layer
.
full_name
)
output_layer_names
.
add
(
layer
.
full_name
)
...
@@ -269,6 +270,13 @@ def parse_network(output_layers, extra_layers=None):
...
@@ -269,6 +270,13 @@ def parse_network(output_layers, extra_layers=None):
output_layer_names
,
evaluator_names
)
output_layer_names
,
evaluator_names
)
model_config
.
sub_models
.
extend
([
s
])
model_config
.
sub_models
.
extend
([
s
])
parameter_names
=
__get_used_parameters__
(
layer_names
,
model_config
.
sub_models
)
for
p
in
cp
.
g_config
.
model_config
.
parameters
:
if
p
.
name
in
parameter_names
:
model_config
.
parameters
.
extend
([
p
])
return
model_config
return
model_config
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录