Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
TonyTonyFun
Paddle
提交
b130ba73
P
Paddle
项目概览
TonyTonyFun
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b130ba73
编写于
9月 20, 2016
作者:
H
Haonan
提交者:
emailweixu
9月 20, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bugs in conv_operator; add calc_output_size (#101)
上级
2c5a6ac0
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
6 deletion
+9
-6
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+5
-3
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+4
-3
未找到文件。
python/paddle/trainer/config_parser.py
浏览文件 @
b130ba73
...
@@ -636,7 +636,6 @@ class Operator(Cfg):
...
@@ -636,7 +636,6 @@ class Operator(Cfg):
input_layer_names
,
input_layer_names
,
):
):
self
.
add_keys
(
locals
())
self
.
add_keys
(
locals
())
self
.
operator_conf
=
OperatorConfig
()
self
.
operator_conf
=
OperatorConfig
()
self
.
operator_conf
.
type
=
self
.
type
self
.
operator_conf
.
type
=
self
.
type
...
@@ -686,12 +685,15 @@ class ConvOperator(Operator):
...
@@ -686,12 +685,15 @@ class ConvOperator(Operator):
if
num_filters
is
not
None
:
if
num_filters
is
not
None
:
self
.
operator_conf
.
num_filters
=
num_filters
self
.
operator_conf
.
num_filters
=
num_filters
parse_conv
(
conv_conf
,
input_layer_names
[
0
],
self
.
operator_conf
.
conv_conf
,
True
)
parse_conv
(
conv_conf
,
MakeLayerNameInSubmodel
(
input_layer_names
[
0
]),
self
.
operator_conf
.
conv_conf
)
self
.
operator_conf
.
output_size
=
(
self
.
operator_conf
.
conv_conf
.
output_x
**
2
)
*
num_filters
self
.
operator_conf
.
output_size
=
(
self
.
operator_conf
.
conv_conf
.
output_x
**
2
)
*
num_filters
config_assert
(
len
(
input_layer_names
)
==
2
,
"Conv is binary operator"
)
config_assert
(
len
(
input_layer_names
)
==
2
,
"Conv is binary operator"
)
def
calc_output_size
(
self
,
input_sizes
):
return
self
.
operator_conf
.
output_size
# please refer to the comments in proto/ModelConfig.proto
# please refer to the comments in proto/ModelConfig.proto
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
b130ba73
...
@@ -2668,7 +2668,7 @@ def classification_cost(input, label, name=None,
...
@@ -2668,7 +2668,7 @@ def classification_cost(input, label, name=None,
return
LayerOutput
(
name
,
LayerType
.
COST
,
parents
=
[
input
,
label
])
return
LayerOutput
(
name
,
LayerType
.
COST
,
parents
=
[
input
,
label
])
def
conv_operator
(
input
,
filter_size
,
num_filters
,
def
conv_operator
(
input
,
filter_size
,
num_filters
,
num_channel
=
None
,
stride
=
1
,
padding
=
0
,
num_channel
=
None
,
stride
=
1
,
padding
=
0
,
groups
=
1
,
filter_size_y
=
None
,
stride_y
=
None
,
padding_y
=
None
):
filter_size_y
=
None
,
stride_y
=
None
,
padding_y
=
None
):
"""
"""
Different from img_conv_layer, conv_op is an Operator, which can be used
Different from img_conv_layer, conv_op is an Operator, which can be used
...
@@ -2715,7 +2715,7 @@ def conv_operator(input, filter_size, num_filters,
...
@@ -2715,7 +2715,7 @@ def conv_operator(input, filter_size, num_filters,
stride_y
=
stride
stride_y
=
stride
if
padding_y
is
None
:
if
padding_y
is
None
:
padding_y
=
padding
padding_y
=
padding
op
=
ConvOperator
(
input_layer_name
=
[
x
.
name
for
x
in
input
],
op
=
ConvOperator
(
input_layer_name
s
=
[
x
.
name
for
x
in
input
],
num_filters
=
num_filter
,
num_filters
=
num_filter
,
conv_conf
=
Conv
(
filter_size
=
filter_size
,
conv_conf
=
Conv
(
filter_size
=
filter_size
,
padding
=
padding
,
padding
=
padding
,
...
@@ -2723,7 +2723,8 @@ def conv_operator(input, filter_size, num_filters,
...
@@ -2723,7 +2723,8 @@ def conv_operator(input, filter_size, num_filters,
channels
=
num_channel
,
channels
=
num_channel
,
filter_size_y
=
filter_size_y
,
filter_size_y
=
filter_size_y
,
padding_y
=
padding_y
,
padding_y
=
padding_y
,
stride_y
=
stride_y
))
stride_y
=
stride_y
,
groups
=
groups
))
op
.
origin
=
input
op
.
origin
=
input
op
.
origin
.
operator
=
"conv_op"
op
.
origin
.
operator
=
"conv_op"
return
op
return
op
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录