Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
fe77223d
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fe77223d
编写于
12月 09, 2019
作者:
D
Dmitry Kurtaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify nGraph's ConvolutionBackpropData and GroupConvolution
上级
a2642d83
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
15 deletion
+11
-15
modules/dnn/src/layers/convolution_layer.cpp
modules/dnn/src/layers/convolution_layer.cpp
+11
-15
未找到文件。
modules/dnn/src/layers/convolution_layer.cpp
浏览文件 @
fe77223d
...
...
@@ -544,6 +544,12 @@ public:
const
int
group
=
inpCn
/
inpGroupCn
;
std
::
vector
<
size_t
>
kernel_shape
=
getShape
<
size_t
>
(
blobs
[
0
]);
if
(
group
!=
1
)
{
kernel_shape
[
0
]
/=
group
;
kernel_shape
.
insert
(
kernel_shape
.
begin
(),
group
);
}
auto
ieWeights
=
std
::
make_shared
<
ngraph
::
op
::
Constant
>
(
ngraph
::
element
::
f32
,
kernel_shape
,
blobs
[
0
].
data
);
if
(
fusedWeights
)
{
...
...
@@ -566,14 +572,12 @@ public:
std
::
shared_ptr
<
ngraph
::
Node
>
conv_node
;
if
(
group
!=
1
)
{
conv_node
=
std
::
make_shared
<
ngraph
::
op
::
GroupConvolution
>
(
conv_node
=
std
::
make_shared
<
ngraph
::
op
::
v1
::
GroupConvolution
>
(
ieInpNode
,
ieWeights
,
ngraph
::
Strides
(
strides
),
ngraph
::
Strides
(
dilations
),
ngraph
::
CoordinateDiff
(
std
::
vector
<
std
::
ptrdiff_t
>
(
pads_begin
.
begin
(),
pads_begin
.
end
())),
ngraph
::
CoordinateDiff
(
std
::
vector
<
std
::
ptrdiff_t
>
(
pads_end
.
begin
(),
pads_end
.
end
())),
ngraph
::
Strides
{},
group
,
ngraph
::
Strides
(
dilations
),
pad_type
);
}
else
{
conv_node
=
std
::
make_shared
<
ngraph
::
op
::
v1
::
Convolution
>
(
...
...
@@ -2037,37 +2041,29 @@ public:
Mat
newWeights
=
blobs
[
0
].
reshape
(
1
,
inpCn
);
transpose
(
weightsMat
,
newWeights
);
}
size_t
batch
=
ieInpNode
->
get_shape
()[
0
];
std
::
vector
<
size_t
>
out_shape
=
{
batch
,
(
size_t
)
numOutput
};
std
::
vector
<
size_t
>
paddings_end
;
std
::
vector
<
size_t
>
inpShape
=
ieInpNode
->
get_shape
();
if
(
padMode
.
empty
())
{
for
(
int
i
=
0
;
i
<
pads_end
.
size
();
i
++
)
{
out_shape
.
push_back
(
strides
[
i
]
*
(
inpShape
[
2
+
i
]
-
1
)
+
kernel_size
[
i
]
-
pads_begin
[
i
]
-
pads_end
[
i
]
+
adjust_pads
[
i
]);
paddings_end
.
push_back
(
pads_end
[
i
]
-
adjust_pads
[
i
]);
}
}
else
if
(
padMode
==
"SAME"
)
{
for
(
int
i
=
0
;
i
<
pads_begin
.
size
();
i
++
)
{
out_shape
.
push_back
(
strides
[
i
]
*
(
inpShape
[
2
+
i
]
-
1
)
+
1
+
adjust_pads
[
i
]);
paddings_end
.
push_back
(
kernel_size
[
i
]
-
pads_begin
[
i
]
-
1
-
adjust_pads
[
i
]);
}
}
else
{
paddings_end
=
pads_end
;
}
auto
deconv
=
std
::
make_shared
<
ngraph
::
op
::
ConvolutionBackpropData
>
(
ngraph
::
Shape
{
out_shape
},
ieWeights
,
auto
deconv
=
std
::
make_shared
<
ngraph
::
op
::
v1
::
ConvolutionBackpropData
>
(
ieInpNode
,
ieWeights
,
ngraph
::
Strides
(
strides
),
ngraph
::
Strides
(
dilations
),
ngraph
::
CoordinateDiff
(
std
::
vector
<
std
::
ptrdiff_t
>
(
pads_begin
.
begin
(),
pads_begin
.
end
())),
ngraph
::
CoordinateDiff
(
std
::
vector
<
std
::
ptrdiff_t
>
(
paddings_end
.
begin
(),
paddings_end
.
end
())),
(
strides
.
size
()
==
2
?
ngraph
::
Strides
{
1
,
1
}
:
ngraph
::
Strides
{
1
,
1
,
1
}
));
ngraph
::
Strides
(
dilations
));
if
(
hasBias
()
||
fusedBias
)
{
std
::
vector
<
size_t
>
shape
(
deconv
->
get_shape
().
size
(),
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录