Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
d131152b
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d131152b
编写于
9月 11, 2017
作者:
C
chengduo
提交者:
GitHub
9月 11, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4021 from chengduoZH/fix_DeConv3D_switch_imgSize_and_output_
fix DeConv3D switch(imgSize*_, output*_)
上级
2de7b216
e9a1f2ad
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
36 deletion
+37
-36
paddle/gserver/layers/DeConv3DLayer.cpp
paddle/gserver/layers/DeConv3DLayer.cpp
+20
-20
paddle/gserver/tests/test_LayerGrad.cpp
paddle/gserver/tests/test_LayerGrad.cpp
+17
-16
未找到文件。
paddle/gserver/layers/DeConv3DLayer.cpp
浏览文件 @
d131152b
...
...
@@ -53,27 +53,27 @@ bool DeConv3DLayer::init(const LayerMap &layerMap,
size_t
DeConv3DLayer
::
getSize
()
{
CHECK_NE
(
inputLayers_
.
size
(),
0UL
);
outputH
_
.
clear
();
outputW
_
.
clear
();
output
D_
.
clear
();
imgSizeW
_
.
clear
();
imgSizeH
_
.
clear
();
imgSize
D_
.
clear
();
N_
.
clear
();
NOut_
.
clear
();
size_t
layerSize
=
0
;
for
(
size_t
i
=
0
;
i
<
inputLayers_
.
size
();
++
i
)
{
output
W_
.
push_back
(
imageSize
(
imgSize
W_
[
i
],
filterSize_
[
i
],
padding_
[
i
],
stride_
[
i
],
true
));
output
H_
.
push_back
(
imageSize
(
imgSize
H_
[
i
],
filterSizeY_
[
i
],
paddingY_
[
i
],
strideY_
[
i
],
true
));
output
D_
.
push_back
(
imageSize
(
imgSize
D_
[
i
],
filterSizeZ_
[
i
],
paddingZ_
[
i
],
strideZ_
[
i
],
true
));
NOut_
.
push_back
(
outputD_
[
i
]
*
outputH_
[
i
]
*
output
W_
[
i
]);
N_
.
push_back
(
imgSizeD_
[
i
]
*
imgSizeH_
[
i
]
*
imgSize
W_
[
i
]);
imgSize
W_
.
push_back
(
imageSize
(
output
W_
[
i
],
filterSize_
[
i
],
padding_
[
i
],
stride_
[
i
],
true
));
imgSize
H_
.
push_back
(
imageSize
(
output
H_
[
i
],
filterSizeY_
[
i
],
paddingY_
[
i
],
strideY_
[
i
],
true
));
imgSize
D_
.
push_back
(
imageSize
(
output
D_
[
i
],
filterSizeZ_
[
i
],
paddingZ_
[
i
],
strideZ_
[
i
],
true
));
NOut_
.
push_back
(
imgSizeD_
[
i
]
*
imgSizeH_
[
i
]
*
imgSize
W_
[
i
]);
N_
.
push_back
(
outputD_
[
i
]
*
outputH_
[
i
]
*
output
W_
[
i
]);
CHECK
(
layerSize
==
0
||
N_
[
i
]
*
size_t
(
numFilters_
)
==
layerSize
);
layerSize
+=
NOut_
[
i
]
*
numFilters_
;
}
getOutput
().
setFrameHeight
(
output
H_
[
0
]);
getOutput
().
setFrameWidth
(
output
W_
[
0
]);
getOutput
().
setFrameDepth
(
output
D_
[
0
]);
getOutput
().
setFrameHeight
(
imgSize
H_
[
0
]);
getOutput
().
setFrameWidth
(
imgSize
W_
[
0
]);
getOutput
().
setFrameDepth
(
imgSize
D_
[
0
]);
return
layerSize
;
}
...
...
@@ -103,9 +103,9 @@ void DeConv3DLayer::forward(PassType passType) {
}
colBuf_
->
col2Vol
(
outMat
->
getData
()
+
n
*
outMat
->
getStride
(),
numFilters_
,
output
D_
[
i
],
output
H_
[
i
],
output
W_
[
i
],
imgSize
D_
[
i
],
imgSize
H_
[
i
],
imgSize
W_
[
i
],
filterSizeZ_
[
i
],
filterSizeY_
[
i
],
filterSize_
[
i
],
...
...
@@ -144,9 +144,9 @@ void DeConv3DLayer::backward(const UpdateCallback &callback) {
colBuf_
->
vol2Col
(
getOutputGrad
()
->
getData
()
+
n
*
getOutputGrad
()
->
getStride
(),
numFilters_
,
output
D_
[
i
],
output
H_
[
i
],
output
W_
[
i
],
imgSize
D_
[
i
],
imgSize
H_
[
i
],
imgSize
W_
[
i
],
filterSizeZ_
[
i
],
filterSizeY_
[
i
],
filterSize_
[
i
],
...
...
paddle/gserver/tests/test_LayerGrad.cpp
浏览文件 @
d131152b
...
...
@@ -2302,26 +2302,27 @@ void test3DDeConvLayer(const string& type, bool trans, bool useGpu) {
conv
->
set_stride
(
2
);
conv
->
set_stride_y
(
2
);
conv
->
set_stride_z
(
2
);
conv
->
set_img_size
(
IMAGE_SIZE
);
conv
->
set_img_size_y
(
IMAGE_SIZE_Y
);
conv
->
set_img_size_z
(
IMAGE_SIZE_Z
);
conv
->
set_output_x
(
imageSize
(
conv
->
img_size
(),
conv
->
set_output_x
(
IMAGE_SIZE
);
conv
->
set_output_y
(
IMAGE_SIZE_Y
);
conv
->
set_output_z
(
IMAGE_SIZE_Z
);
conv
->
set_img_size
(
imageSize
(
conv
->
output_x
(),
conv
->
filter_size
(),
conv
->
padding
(),
conv
->
stride
(),
true
));
conv
->
set_
output_y
(
imageSize
(
conv
->
img_size
_y
(),
conv
->
filter_size_y
(),
conv
->
padding_y
(),
conv
->
stride_y
(),
true
));
conv
->
set_
output_z
(
imageSize
(
conv
->
img_size
_z
(),
conv
->
filter_size_z
(),
conv
->
padding_z
(),
conv
->
stride_z
(),
true
));
config
.
layerConfig
.
set_size
(
conv
->
output_x
()
*
conv
->
output
_y
()
*
conv
->
output
_z
()
*
NUM_FILTERS
);
conv
->
set_
img_size_y
(
imageSize
(
conv
->
output
_y
(),
conv
->
filter_size_y
(),
conv
->
padding_y
(),
conv
->
stride_y
(),
true
));
conv
->
set_
img_size_z
(
imageSize
(
conv
->
output
_z
(),
conv
->
filter_size_z
(),
conv
->
padding_z
(),
conv
->
stride_z
(),
true
));
config
.
layerConfig
.
set_size
(
conv
->
img_size
()
*
conv
->
img_size
_y
()
*
conv
->
img_size
_z
()
*
NUM_FILTERS
);
conv
->
set_groups
(
1
);
conv
->
set_filter_channels
(
conv
->
channels
()
/
conv
->
groups
());
config
.
inputDefs
.
push_back
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录