Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
7a5b3846
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7a5b3846
编写于
10月 27, 2017
作者:
X
xzl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support exconv dilation
上级
aa3de357
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
5 deletion
+25
-5
paddle/function/ConvOp.h
paddle/function/ConvOp.h
+6
-0
paddle/function/GemmConvOp.cpp
paddle/function/GemmConvOp.cpp
+9
-3
paddle/gserver/layers/ExpandConvLayer.cpp
paddle/gserver/layers/ExpandConvLayer.cpp
+10
-2
未找到文件。
paddle/function/ConvOp.h
浏览文件 @
7a5b3846
...
...
@@ -61,6 +61,7 @@ public:
// function arguments
strides_
=
config
.
get
<
std
::
vector
<
size_t
>>
(
"strides"
);
paddings_
=
config
.
get
<
std
::
vector
<
size_t
>>
(
"paddings"
);
dilations_
=
config
.
get
<
std
::
vector
<
size_t
>>
(
"dilations"
);
groups_
=
config
.
get
<
size_t
>
(
"groups"
);
// number of inputs and outputs
...
...
@@ -118,6 +119,7 @@ protected:
std
::
vector
<
size_t
>
strides_
;
std
::
vector
<
size_t
>
paddings_
;
std
::
vector
<
size_t
>
dilations_
;
/// Group size, refer to grouped convolution in
/// Alex Krizhevsky's paper: when group=2, the first half of the
...
...
@@ -133,6 +135,10 @@ protected:
inline
int
paddingW
()
const
{
return
paddings_
[
1
];
}
inline
int
dilationH
()
const
{
return
dilations_
[
0
];
}
inline
int
dilationW
()
const
{
return
dilations_
[
1
];
}
// A temporary memory in convolution calculation.
MemoryHandlePtr
memory_
;
...
...
paddle/function/GemmConvOp.cpp
浏览文件 @
7a5b3846
...
...
@@ -100,7 +100,9 @@ public:
strideH
(),
strideW
(),
paddingH
(),
paddingW
());
paddingW
(),
dilationH
(),
dilationW
());
}
else
{
colData
=
inputData
+
g
*
inputOffset
;
}
...
...
@@ -223,7 +225,9 @@ public:
strideH
(),
strideW
(),
paddingH
(),
paddingW
());
paddingW
(),
dilationH
(),
dilationW
());
}
}
inputGrad
+=
inputChannels
*
inputHeight
*
inputWidth
;
...
...
@@ -310,7 +314,9 @@ public:
strideH
(),
strideW
(),
paddingH
(),
paddingW
());
paddingW
(),
dilationH
(),
dilationW
());
}
else
{
colData
=
inputData
+
g
*
inputOffset
;
}
...
...
paddle/gserver/layers/ExpandConvLayer.cpp
浏览文件 @
7a5b3846
...
...
@@ -79,6 +79,10 @@ bool ExpandConvLayer::init(const LayerMap &layerMap,
for
(
int
i
=
0
;
i
<
config_
.
inputs_size
();
i
++
)
{
std
::
vector
<
size_t
>
paddings
=
{(
size_t
)
paddingY_
[
i
],
(
size_t
)
padding_
[
i
]};
std
::
vector
<
size_t
>
strides
=
{(
size_t
)
strideY_
[
i
],
(
size_t
)
stride_
[
i
]};
std
::
vector
<
size_t
>
dilations
=
{(
size_t
)
dilationY_
[
i
],
(
size_t
)
dilation_
[
i
]};
bool
useDilation
=
((
size_t
)
dilationY_
[
i
]
>
1
||
(
size_t
)
dilation_
[
i
]
>
1
);
// Convolution Layer uses the GemmConv function by default.
convType
=
"GemmConv"
;
...
...
@@ -97,13 +101,14 @@ bool ExpandConvLayer::init(const LayerMap &layerMap,
#if defined(__ARM_NEON__) || defined(__ARM_NEON)
if
((
filterSize_
[
i
]
==
filterSizeY_
[
i
])
&&
(
filterSize_
[
i
]
==
3
||
filterSize_
[
i
]
==
4
)
&&
(
stride_
[
i
]
==
strideY_
[
i
])
&&
(
stride_
[
i
]
==
1
||
stride_
[
i
]
==
2
))
{
(
stride_
[
i
]
==
strideY_
[
i
])
&&
(
stride_
[
i
]
==
1
||
stride_
[
i
]
==
2
)
&&
!
useDilation
)
{
convType
=
"NeonDepthwiseConv"
;
}
#endif
}
if
(
FLAGS_use_nnpack
&&
!
isDeconv_
)
{
if
(
FLAGS_use_nnpack
&&
!
isDeconv_
&&
!
useDilation
)
{
createFunction
(
forward_
,
"NNPACKConv"
,
FuncConfig
()
...
...
@@ -117,6 +122,7 @@ bool ExpandConvLayer::init(const LayerMap &layerMap,
FuncConfig
()
.
set
(
"paddings"
,
paddings
)
.
set
(
"strides"
,
strides
)
.
set
(
"dilations"
,
dilations
)
.
set
(
"groups"
,
(
size_t
)
groups_
[
i
]));
createFunction
(
backward_
,
...
...
@@ -124,6 +130,7 @@ bool ExpandConvLayer::init(const LayerMap &layerMap,
FuncConfig
()
.
set
(
"paddings"
,
paddings
)
.
set
(
"strides"
,
strides
)
.
set
(
"dilations"
,
dilations
)
.
set
(
"groups"
,
(
size_t
)
groups_
[
i
]));
createFunction
(
backward_
,
...
...
@@ -131,6 +138,7 @@ bool ExpandConvLayer::init(const LayerMap &layerMap,
FuncConfig
()
.
set
(
"paddings"
,
paddings
)
.
set
(
"strides"
,
strides
)
.
set
(
"dilations"
,
dilations
)
.
set
(
"groups"
,
(
size_t
)
groups_
[
i
]));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录