Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
9b54ad18
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
9b54ad18
编写于
9月 30, 2017
作者:
C
caoying03
提交者:
dongzhihong
10月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add configuration helper for resize layer.
上级
e9a9dd6d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
64 addition
and
3 deletion
+64
-3
doc/api/v1/index_cn.rst
doc/api/v1/index_cn.rst
+1
-1
doc/api/v2/config/layer.rst
doc/api/v2/config/layer.rst
+5
-0
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+24
-1
python/paddle/trainer_config_helpers/tests/configs/file_list.sh
.../paddle/trainer_config_helpers/tests/configs/file_list.sh
+1
-1
python/paddle/trainer_config_helpers/tests/configs/protostr/test_resize_layer.protostr
...helpers/tests/configs/protostr/test_resize_layer.protostr
+27
-0
python/paddle/trainer_config_helpers/tests/configs/test_resize_layer.py
...trainer_config_helpers/tests/configs/test_resize_layer.py
+6
-0
未找到文件。
doc/api/v1/index_cn.rst
浏览文件 @
9b54ad18
doc/api/v2/config/layer.rst
浏览文件 @
9b54ad18
...
...
@@ -345,6 +345,11 @@ clip
.. autoclass:: paddle.v2.layer.clip
:noindex:
resize
------
.. autoclass:: paddle.v2.layer.resize
:noindex:
slope_intercept
---------------
.. autoclass:: paddle.v2.layer.slope_intercept
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
9b54ad18
...
...
@@ -142,6 +142,7 @@ __all__ = [
'img_pool3d_layer'
,
'scale_shift_layer'
,
'img_conv3d_layer'
,
'resize_layer'
,
]
...
...
@@ -250,6 +251,8 @@ class LayerType(object):
KMAX_SEQ_SCORE
=
'kmax_seq_score'
SCALE_SHIFT_LAYER
=
'scale_shift'
RESIZE
=
'resize'
@
staticmethod
def
is_layer_type
(
type_name
):
"""
...
...
@@ -6932,3 +6935,23 @@ def scale_shift_layer(input, name=None, param_attr=None, bias_attr=None):
bias
=
ParamAttr
.
to_bias
(
bias_attr
))
return
LayerOutput
(
name
,
LayerType
.
SCALE_SHIFT_LAYER
,
parents
=
[
input
],
size
=
input
.
size
)
@
wrap_name_default
(
"resize"
)
def
resize_layer
(
input
,
size
,
name
=
None
):
"""
The resize layer resizes the input matrix with a shape of [Height, Width]
into the output matrix with a shape of [Height x Width / size, size],
where size is the parameter of this layer indicating the output dimension.
:param input: The input to this layer.
:type input: LayerOutput.
:param name: The name of this layer. It is optional.
:type name: basestring
:param size: The resized output dimesion of this layer.
:type size: int
:return: A LayerOutput object.
:rtype: LayerOutput
"""
Layer
(
name
=
name
,
type
=
LayerType
.
RESIZE
,
inputs
=
Input
(
input
.
name
),
size
=
size
)
return
LayerOutput
(
name
,
LayerType
.
RESIZE
,
parents
=
[
input
],
size
=
input
.
size
)
python/paddle/trainer_config_helpers/tests/configs/file_list.sh
浏览文件 @
9b54ad18
...
...
@@ -10,6 +10,6 @@ test_prelu_layer test_row_conv test_detection_output_layer test_multibox_loss_la
test_recursive_topology test_gated_unit_layer test_clip_layer test_row_l2_norm_layer
test_kmax_seq_socre_layer test_sub_nested_seq_select_layer test_scale_shift_layer
test_seq_slice_layer test_cross_entropy_over_beam test_pooling3D_layer
test_conv3d_layer test_deconv3d_layer test_BatchNorm3D
)
test_conv3d_layer test_deconv3d_layer test_BatchNorm3D
test_resize_layer
)
export
whole_configs
=(
test_split_datasource
)
python/paddle/trainer_config_helpers/tests/configs/protostr/test_resize_layer.protostr
0 → 100644
浏览文件 @
9b54ad18
type: "nn"
layers {
name: "input"
type: "data"
size: 300
active_type: ""
}
layers {
name: "__resize_0__"
type: "resize"
size: 150
active_type: ""
inputs {
input_layer_name: "input"
}
}
input_layer_names: "input"
output_layer_names: "__resize_0__"
sub_models {
name: "root"
layer_names: "input"
layer_names: "__resize_0__"
input_layer_names: "input"
output_layer_names: "__resize_0__"
is_recurrent_layer_group: false
}
python/paddle/trainer_config_helpers/tests/configs/test_resize_layer.py
0 → 100644
浏览文件 @
9b54ad18
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
)
resized
=
resize_layer
(
input
=
data
,
size
=
150
)
outputs
(
resized
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录