Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
7829034d
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看板
提交
7829034d
编写于
11月 10, 2017
作者:
G
guosheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refine ROIPoolLayer by following comments
上级
1ffdecf1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
3 deletion
+8
-3
paddle/gserver/layers/ROIPoolLayer.cpp
paddle/gserver/layers/ROIPoolLayer.cpp
+2
-0
paddle/gserver/layers/ROIPoolLayer.h
paddle/gserver/layers/ROIPoolLayer.h
+1
-0
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+3
-2
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+2
-1
未找到文件。
paddle/gserver/layers/ROIPoolLayer.cpp
浏览文件 @
7829034d
...
@@ -91,6 +91,8 @@ void ROIPoolLayer::forward(PassType passType) {
...
@@ -91,6 +91,8 @@ void ROIPoolLayer::forward(PassType passType) {
real
*
argmaxData
=
maxIdxs_
->
getData
();
real
*
argmaxData
=
maxIdxs_
->
getData
();
for
(
size_t
n
=
0
;
n
<
numROIs
;
++
n
)
{
for
(
size_t
n
=
0
;
n
<
numROIs
;
++
n
)
{
// the first five elememts of each RoI should be:
// batch_idx, roi_x_start, roi_y_start, roi_x_end, roi_y_end
size_t
roiBatchIdx
=
bottomROIs
[
0
];
size_t
roiBatchIdx
=
bottomROIs
[
0
];
size_t
roiStartW
=
round
(
bottomROIs
[
1
]
*
spatialScale_
);
size_t
roiStartW
=
round
(
bottomROIs
[
1
]
*
spatialScale_
);
size_t
roiStartH
=
round
(
bottomROIs
[
2
]
*
spatialScale_
);
size_t
roiStartH
=
round
(
bottomROIs
[
2
]
*
spatialScale_
);
...
...
paddle/gserver/layers/ROIPoolLayer.h
浏览文件 @
7829034d
...
@@ -41,6 +41,7 @@ protected:
...
@@ -41,6 +41,7 @@ protected:
size_t
pooledHeight_
;
size_t
pooledHeight_
;
real
spatialScale_
;
real
spatialScale_
;
// Since there is no int matrix, use real maxtrix instead.
MatrixPtr
maxIdxs_
;
MatrixPtr
maxIdxs_
;
public:
public:
...
...
python/paddle/trainer/config_parser.py
浏览文件 @
7829034d
...
@@ -1971,13 +1971,14 @@ class DetectionOutputLayer(LayerBase):
...
@@ -1971,13 +1971,14 @@ class DetectionOutputLayer(LayerBase):
@
config_layer
(
'roi_pool'
)
@
config_layer
(
'roi_pool'
)
class
ROIPoolLayer
(
LayerBase
):
class
ROIPoolLayer
(
LayerBase
):
def
__init__
(
self
,
name
,
inputs
,
pooled_width
,
pooled_height
,
def
__init__
(
self
,
name
,
inputs
,
pooled_width
,
pooled_height
,
spatial_scale
,
spatial_scale
):
num_channels
,
**
xargs
):
super
(
ROIPoolLayer
,
self
).
__init__
(
name
,
'roi_pool'
,
0
,
inputs
)
super
(
ROIPoolLayer
,
self
).
__init__
(
name
,
'roi_pool'
,
0
,
inputs
)
config_assert
(
len
(
inputs
)
==
2
,
'ROIPoolLayer must have 2 inputs'
)
config_assert
(
len
(
inputs
)
==
2
,
'ROIPoolLayer must have 2 inputs'
)
self
.
config
.
inputs
[
0
].
roi_pool_conf
.
pooled_width
=
pooled_width
self
.
config
.
inputs
[
0
].
roi_pool_conf
.
pooled_width
=
pooled_width
self
.
config
.
inputs
[
0
].
roi_pool_conf
.
pooled_height
=
pooled_height
self
.
config
.
inputs
[
0
].
roi_pool_conf
.
pooled_height
=
pooled_height
self
.
config
.
inputs
[
0
].
roi_pool_conf
.
spatial_scale
=
spatial_scale
self
.
config
.
inputs
[
0
].
roi_pool_conf
.
spatial_scale
=
spatial_scale
self
.
set_cnn_layer
(
name
,
pooled_height
,
pooled_width
,
num_channels
)
@
config_layer
(
'data'
)
@
config_layer
(
'data'
)
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
7829034d
...
@@ -1345,7 +1345,8 @@ def roi_pool_layer(input,
...
@@ -1345,7 +1345,8 @@ def roi_pool_layer(input,
inputs
=
[
input
.
name
,
rois
.
name
],
inputs
=
[
input
.
name
,
rois
.
name
],
pooled_width
=
pooled_width
,
pooled_width
=
pooled_width
,
pooled_height
=
pooled_height
,
pooled_height
=
pooled_height
,
spatial_scale
=
spatial_scale
)
spatial_scale
=
spatial_scale
,
num_channels
=
num_channels
)
return
LayerOutput
(
return
LayerOutput
(
name
,
LayerType
.
ROI_POOL_LAYER
,
parents
=
[
input
,
rois
],
size
=
size
)
name
,
LayerType
.
ROI_POOL_LAYER
,
parents
=
[
input
,
rois
],
size
=
size
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录