Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a54565ea
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看板
提交
a54565ea
编写于
11月 10, 2017
作者:
X
xzl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete mask pool interface from poolprojection
上级
8106f414
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
38 addition
and
311 deletion
+38
-311
paddle/cuda/include/hl_cnn.h
paddle/cuda/include/hl_cnn.h
+2
-41
paddle/cuda/include/stub/hl_cnn_stub.h
paddle/cuda/include/stub/hl_cnn_stub.h
+1
-18
paddle/cuda/src/hl_cuda_cnn.cu
paddle/cuda/src/hl_cuda_cnn.cu
+4
-47
paddle/gserver/layers/PoolLayer.cpp
paddle/gserver/layers/PoolLayer.cpp
+4
-7
paddle/gserver/layers/PoolLayer.h
paddle/gserver/layers/PoolLayer.h
+0
-2
paddle/gserver/layers/PoolProjection.cpp
paddle/gserver/layers/PoolProjection.cpp
+2
-35
paddle/gserver/layers/PoolProjection.h
paddle/gserver/layers/PoolProjection.h
+0
-11
paddle/gserver/layers/PoolProjectionLayer.cpp
paddle/gserver/layers/PoolProjectionLayer.cpp
+1
-8
paddle/gserver/layers/Projection.h
paddle/gserver/layers/Projection.h
+0
-13
paddle/gserver/tests/test_MaxPoolingWithMaskOutput.cpp
paddle/gserver/tests/test_MaxPoolingWithMaskOutput.cpp
+13
-11
paddle/math/Matrix.cpp
paddle/math/Matrix.cpp
+7
-66
paddle/math/Matrix.h
paddle/math/Matrix.h
+4
-52
未找到文件。
paddle/cuda/include/hl_cnn.h
浏览文件 @
a54565ea
...
...
@@ -35,8 +35,7 @@ limitations under the License. */
* @param[in] paddingW padding width.
* @param[out] tgtData output data.
* @param[in] tgtStride stride between output data samples.
* @param[out] maskData the location indices of select max data
* @param[in] withMask set true if output maskData
* @param[out] maskData the location indices of select max data.
*/
extern
void
hl_maxpool_forward
(
const
int
frameCnt
,
const
real
*
inputData
,
...
...
@@ -53,45 +52,7 @@ extern void hl_maxpool_forward(const int frameCnt,
const
int
paddingW
,
real
*
tgtData
,
const
int
tgtStride
,
real
*
maskData
,
bool
withMask
);
/**
* @brief Maximum pool forward.
*
* @param[in] frameCnt batch size of input image.
* @param[in] inputData input data.
* @param[in] channels number of channel.
* @param[in] height image height.
* @param[in] width image width.
* @param[in] pooledH output image height.
* @param[in] pooledW output image width.
* @param[in] sizeX width of pooling window.
* @param[in] sizeY height of pooling window.
* @param[in] strideH pooling stride height.
* @param[in] strideW pooling stride width.
* @param[in] paddingH padding height.
* @param[in] paddingW padding width.
* @param[out] tgtData output data.
* @param[in] tgtStride stride between output data samples.
* @param[out] maskData the location indices of select max data
* @param[in] withMask set true if output maskData
*/
extern
void
hl_maxpool_forward
(
const
int
frameCnt
,
const
real
*
inputData
,
const
int
channels
,
const
int
height
,
const
int
width
,
const
int
pooledH
,
const
int
pooledW
,
const
int
sizeX
,
const
int
sizeY
,
const
int
strideH
,
const
int
strideW
,
const
int
paddingH
,
const
int
paddingW
,
real
*
tgtData
,
const
int
tgtStride
);
real
*
maskData
=
NULL
);
/**
* @brief Maximum pool backward.
...
...
paddle/cuda/include/stub/hl_cnn_stub.h
浏览文件 @
a54565ea
...
...
@@ -17,22 +17,6 @@ limitations under the License. */
#include "hl_cnn.h"
inline
void
hl_maxpool_forward
(
const
int
frameCnt
,
const
real
*
inputData
,
const
int
channels
,
const
int
height
,
const
int
width
,
const
int
pooledH
,
const
int
pooledW
,
const
int
sizeX
,
const
int
sizeY
,
const
int
strideH
,
const
int
strideW
,
const
int
paddingH
,
const
int
paddingW
,
real
*
tgtData
,
const
int
tgtStride
)
{}
inline
void
hl_maxpool_forward
(
const
int
frameCnt
,
const
real
*
inputData
,
const
int
channels
,
...
...
@@ -48,8 +32,7 @@ inline void hl_maxpool_forward(const int frameCnt,
const
int
paddingW
,
real
*
tgtData
,
const
int
tgtStride
,
real
*
MaskData
,
bool
withMask
)
{}
real
*
MaskData
=
NULL
)
{}
inline
void
hl_maxpool_backward
(
const
int
frameCnt
,
const
real
*
inputData
,
...
...
paddle/cuda/src/hl_cuda_cnn.cu
浏览文件 @
a54565ea
...
...
@@ -32,8 +32,7 @@ __global__ void KeMaxPoolForward(const int nthreads,
const
int
offsetW
,
real
*
tgtData
,
const
int
tgtStride
,
real
*
maskData
,
bool
withMask
)
{
real
*
maskData
)
{
int
index
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
if
(
index
<
nthreads
)
{
int
pw
=
index
%
pooledW
;
...
...
@@ -60,52 +59,12 @@ __global__ void KeMaxPoolForward(const int nthreads,
int
tgtIndex
=
index
%
(
pooledW
*
pooledH
*
channels
)
+
frameNum
*
tgtStride
;
tgtData
[
tgtIndex
]
=
maxval
;
if
(
withMask
)
{
if
(
maskData
!=
NULL
)
{
maskData
[
tgtIndex
]
=
max_index
;
}
}
}
void
hl_maxpool_forward
(
const
int
frameCnt
,
const
real
*
inputData
,
const
int
channels
,
const
int
height
,
const
int
width
,
const
int
pooledH
,
const
int
pooledW
,
const
int
sizeX
,
const
int
sizeY
,
const
int
strideH
,
const
int
strideW
,
const
int
paddingH
,
const
int
paddingW
,
real
*
tgtData
,
const
int
tgtStride
)
{
int
num_kernels
=
pooledH
*
pooledW
*
channels
*
frameCnt
;
int
blocks
=
(
num_kernels
+
1024
-
1
)
/
1024
;
dim3
threads
(
1024
,
1
);
dim3
grid
(
blocks
,
1
);
KeMaxPoolForward
<<<
grid
,
threads
,
0
,
STREAM_DEFAULT
>>>
(
num_kernels
,
inputData
,
channels
,
height
,
width
,
pooledH
,
pooledW
,
sizeX
,
sizeY
,
strideH
,
strideW
,
paddingH
,
paddingW
,
tgtData
,
tgtStride
,
NULL
,
false
);
CHECK_SYNC
(
"hl_maxpool_forward failed"
);
}
void
hl_maxpool_forward
(
const
int
frameCnt
,
const
real
*
inputData
,
const
int
channels
,
...
...
@@ -121,8 +80,7 @@ void hl_maxpool_forward(const int frameCnt,
const
int
paddingW
,
real
*
tgtData
,
const
int
tgtStride
,
real
*
maskData
,
bool
withMask
)
{
real
*
maskData
)
{
int
num_kernels
=
pooledH
*
pooledW
*
channels
*
frameCnt
;
int
blocks
=
(
num_kernels
+
1024
-
1
)
/
1024
;
dim3
threads
(
1024
,
1
);
...
...
@@ -143,8 +101,7 @@ void hl_maxpool_forward(const int frameCnt,
paddingW
,
tgtData
,
tgtStride
,
maskData
,
withMask
);
maskData
);
CHECK_SYNC
(
"hl_maxpool_forward failed"
);
}
...
...
paddle/gserver/layers/PoolLayer.cpp
浏览文件 @
a54565ea
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "PoolLayer.h"
#include "MaxPoolWithMaskLayer.h"
#include "PoolProjectionLayer.h"
#include "paddle/utils/Logging.h"
#ifdef PADDLE_WITH_CUDA
...
...
@@ -44,24 +45,20 @@ bool PoolLayer::init(const LayerMap& layerMap,
strideY_
=
conf
.
has_stride_y
()
?
conf
.
stride_y
()
:
conf
.
stride
();
confPaddingY_
=
conf
.
has_padding_y
()
?
conf
.
padding_y
()
:
conf
.
padding
();
outputY_
=
conf
.
has_output_y
()
?
conf
.
output_y
()
:
conf
.
output_x
();
with_mask_
=
false
;
if
(
poolType_
==
"max-pool-with-mask"
)
{
setOutput
(
"mask"
,
&
mask_
);
with_mask_
=
true
;
}
return
true
;
}
Layer
*
PoolLayer
::
create
(
const
LayerConfig
&
config
)
{
CHECK_EQ
(
config
.
inputs_size
(),
1
);
const
std
::
string
&
pool
=
config
.
inputs
(
0
).
pool_conf
().
pool_type
();
if
(
pool
==
"max-projection"
||
pool
==
"avg-projection"
||
pool
==
"max-pool-with-mask"
)
{
if
(
pool
==
"max-projection"
||
pool
==
"avg-projection"
)
{
return
new
PoolProjectionLayer
(
config
);
#ifdef PADDLE_WITH_CUDA
}
else
if
(
CudnnPoolLayer
::
typeCheck
(
pool
))
{
return
new
CudnnPoolLayer
(
config
);
#endif
}
else
if
(
pool
==
"max-pool-with-mask"
)
{
return
new
MaxPoolWithMaskLayer
(
config
);
}
else
{
LOG
(
FATAL
)
<<
"Unknown pool type: "
<<
pool
;
return
nullptr
;
...
...
paddle/gserver/layers/PoolLayer.h
浏览文件 @
a54565ea
...
...
@@ -37,8 +37,6 @@ protected:
int
confPaddingY_
;
std
::
string
poolType_
;
bool
with_mask_
;
Argument
mask_
;
public:
explicit
PoolLayer
(
const
LayerConfig
&
config
)
:
Layer
(
config
)
{}
...
...
paddle/gserver/layers/PoolProjection.cpp
浏览文件 @
a54565ea
...
...
@@ -36,10 +36,6 @@ PoolProjection::PoolProjection(const ProjectionConfig& config,
strideY_
=
conf
.
has_stride_y
()
?
conf
.
stride_y
()
:
conf
.
stride
();
confPaddingY_
=
conf
.
has_padding_y
()
?
conf
.
padding_y
()
:
conf
.
padding
();
outputY_
=
conf
.
has_output_y
()
?
conf
.
output_y
()
:
conf
.
output_x
();
with_mask_
=
false
;
if
(
poolType_
==
"max-pool-with-mask"
)
{
with_mask_
=
true
;
}
}
size_t
PoolProjection
::
getSize
()
{
...
...
@@ -77,8 +73,6 @@ PoolProjection* PoolProjection::create(const ProjectionConfig& config,
return
new
MaxPoolProjection
(
config
,
parameter
,
useGpu
);
}
else
if
(
pool
==
"avg-projection"
)
{
return
new
AvgPoolProjection
(
config
,
parameter
,
useGpu
);
}
else
if
(
pool
==
"max-pool-with-mask"
)
{
return
new
MaxPoolProjection
(
config
,
parameter
,
useGpu
);
}
else
{
LOG
(
FATAL
)
<<
"Unknown pool type: "
<<
pool
;
return
nullptr
;
...
...
@@ -90,10 +84,7 @@ void MaxPoolProjection::forward() {
CHECK_EQ
(
width
,
out_
->
value
->
getWidth
());
MatrixPtr
inputV
=
in_
->
value
;
MatrixPtr
outV
=
out_
->
value
;
MatrixPtr
maskV
=
out_
->
value
;
if
(
with_mask_
)
{
maskV
=
mask_
->
value
;
}
outV
->
maxPoolForward
(
*
inputV
,
imgSizeY_
,
imgSize_
,
...
...
@@ -105,9 +96,7 @@ void MaxPoolProjection::forward() {
outputY_
,
outputX_
,
confPaddingY_
,
confPadding_
,
maskV
,
with_mask_
);
confPadding_
);
}
void
MaxPoolProjection
::
backward
(
const
UpdateCallback
&
callback
)
{
...
...
@@ -180,26 +169,4 @@ void AvgPoolProjection::backward(const UpdateCallback& callback) {
confPaddingY_
,
confPadding_
);
}
void
MaxWithMaskPoolProjection
::
forward
()
{
size_t
width
=
getSize
();
CHECK_EQ
(
width
,
out_
->
value
->
getWidth
());
MatrixPtr
inputV
=
in_
->
value
;
MatrixPtr
outV
=
out_
->
value
;
MatrixPtr
maskV
=
mask_
->
value
;
outV
->
maxPoolForward
(
*
inputV
,
imgSizeY_
,
imgSize_
,
channels_
,
sizeX_
,
sizeY_
,
strideY_
,
stride_
,
outputY_
,
outputX_
,
confPaddingY_
,
confPadding_
,
maskV
,
with_mask_
);
}
}
// namespace paddle
paddle/gserver/layers/PoolProjection.h
浏览文件 @
a54565ea
...
...
@@ -28,7 +28,6 @@ protected:
int
confPaddingY_
,
confPadding_
;
size_t
channels_
;
std
::
string
poolType_
;
bool
with_mask_
;
public:
PoolProjection
(
const
ProjectionConfig
&
config
,
...
...
@@ -65,14 +64,4 @@ public:
virtual
void
backward
(
const
UpdateCallback
&
callback
=
nullptr
);
};
class
MaxWithMaskPoolProjection
:
public
MaxPoolProjection
{
public:
MaxWithMaskPoolProjection
(
const
ProjectionConfig
&
config
,
ParameterPtr
parameter
,
bool
useGpu
)
:
MaxPoolProjection
(
config
,
parameter
,
useGpu
)
{}
virtual
void
forward
();
};
}
// namespace paddle
paddle/gserver/layers/PoolProjectionLayer.cpp
浏览文件 @
a54565ea
...
...
@@ -52,15 +52,8 @@ void PoolProjectionLayer::forward(PassType passType) {
int
batchSize
=
in
.
value
->
getHeight
();
int
size
=
getSize
();
if
(
with_mask_
)
{
resetSpecifyOutput
(
mask_
,
batchSize
,
size
,
/* isValueClean */
false
,
/* isGradClean */
true
);
}
resetOutput
(
batchSize
,
size
);
poolProjection_
->
forward
(
&
in
,
&
output_
,
&
mask_
,
passType
);
poolProjection_
->
forward
(
&
in
,
&
output_
,
passType
);
}
void
PoolProjectionLayer
::
backward
(
const
UpdateCallback
&
callback
)
{
...
...
paddle/gserver/layers/Projection.h
浏览文件 @
a54565ea
...
...
@@ -69,17 +69,6 @@ public:
forward
();
}
void
forward
(
const
Argument
*
in
,
const
Argument
*
out
,
const
Argument
*
mask
,
PassType
passType
)
{
in_
=
in
;
out_
=
out
;
mask_
=
mask
;
passType_
=
passType
;
forward
();
}
virtual
void
prefetch
(
const
Argument
*
in
)
{}
virtual
void
forward
()
=
0
;
virtual
void
backward
(
const
UpdateCallback
&
callback
)
=
0
;
...
...
@@ -141,8 +130,6 @@ protected:
const
Argument
*
in_
;
/// Store `out` passed to forward()
const
Argument
*
out_
;
/// Store `mask` passed to forward()
const
Argument
*
mask_
;
/// Store `passType` passed to forward()
PassType
passType_
;
/// Layer forward function
...
...
paddle/gserver/tests/test_MaxPoolingWithMaskOutput.cpp
浏览文件 @
a54565ea
...
...
@@ -68,7 +68,7 @@ void doOneMaxPoolingWithMaskOutputTest(MatrixPtr& inputMat,
std
::
vector
<
DataLayerPtr
>
dataLayers
;
LayerMap
layerMap
;
vector
<
Argument
>
datas
;
;
initDataLayer
(
config
,
&
dataLayers
,
&
datas
,
...
...
@@ -85,7 +85,7 @@ void doOneMaxPoolingWithMaskOutputTest(MatrixPtr& inputMat,
LayerPtr
maxPoolingWithMaskOutputLayer
;
initTestLayer
(
config
,
&
layerMap
,
&
parameters
,
&
maxPoolingWithMaskOutputLayer
);
maxPoolingWithMaskOutputLayer
->
forward
(
PASS_GC
);
;
checkMatrixEqual
(
maxPoolingWithMaskOutputLayer
->
getOutput
(
"mask"
).
value
,
maskMat
);
}
...
...
@@ -105,13 +105,15 @@ TEST(Layer, maxPoolingWithMaskOutputLayerFwd) {
maskMat
->
setData
(
maskData
);
doOneMaxPoolingWithMaskOutputTest
(
inputMat
,
"max-pool-with-mask"
,
useGpu
,
maskMat
);
#ifdef PADDLE_WITH_CUDA
useGpu
=
true
;
inputMat
=
Matrix
::
create
(
1
,
25
,
false
,
useGpu
);
maskMat
=
Matrix
::
create
(
1
,
4
,
false
,
useGpu
);
inputMat
->
copyFrom
(
inputData
,
25
);
maskMat
->
copyFrom
(
maskData
,
4
);
doOneMaxPoolingWithMaskOutputTest
(
inputMat
,
"max-pool-with-mask"
,
useGpu
,
maskMat
);
#endif
/*
#ifdef PADDLE_WITH_CUDA
useGpu = true;
inputMat = Matrix::create(1, 25, false, useGpu);
maskMat = Matrix::create(1, 4, false, useGpu);
inputMat->copyFrom(inputData, 25);
maskMat->copyFrom(maskData, 4);
doOneMaxPoolingWithMaskOutputTest(
inputMat, "max-pool-with-mask", useGpu, maskMat);
#endif
*/
}
paddle/math/Matrix.cpp
浏览文件 @
a54565ea
...
...
@@ -1017,34 +1017,6 @@ void GpuMatrix::check(std::ostream& os, Matrix& refMat, bool printDiff) {
LOG
(
INFO
)
<<
"the diffCnt is "
<<
diffCnt
;
}
void
GpuMatrix
::
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
size_t
channels
,
size_t
sizeX
,
size_t
sizeY
,
size_t
strideH
,
size_t
strideW
,
size_t
outputH
,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
)
{
maxPoolForward
(
inputMat
,
imgSizeH
,
imgSizeW
,
channels
,
sizeX
,
sizeY
,
strideH
,
strideW
,
outputH
,
outputW
,
paddingH
,
paddingW
,
NULL
,
false
);
}
void
GpuMatrix
::
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
...
...
@@ -1057,8 +1029,7 @@ void GpuMatrix::maxPoolForward(Matrix& inputMat,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
,
MatrixPtr
maskMatP
,
bool
withMask
)
{
MatrixPtr
maskMatP
)
{
CHECK
(
inputMat
.
useGpu_
==
true
)
<<
"Matrix type are not equal"
;
real
*
inputData
=
inputMat
.
getData
();
...
...
@@ -1068,7 +1039,7 @@ void GpuMatrix::maxPoolForward(Matrix& inputMat,
CHECK
(
height_
==
inputMat
.
getHeight
());
CHECK
(
width_
==
outputH
*
outputW
*
channels
);
if
(
withMask
)
{
if
(
maskMatP
!=
NULL
)
{
CHECK
(
maskMatP
->
useGpu_
==
true
)
<<
"Matrix type are not equal"
;
CHECK
(
outputH
*
outputW
*
channels
==
maskMatP
->
getWidth
());
maskData
=
maskMatP
->
getData
();
...
...
@@ -1089,8 +1060,7 @@ void GpuMatrix::maxPoolForward(Matrix& inputMat,
paddingW
,
data_
,
getStride
(),
maskData
,
withMask
);
maskData
);
}
void
GpuMatrix
::
maxPoolBackward
(
Matrix
&
inputMat
,
...
...
@@ -2001,34 +1971,6 @@ void CpuMatrix::inverse(MatrixPtr& matInv, bool memAlloc) {
CHECK_EQ
(
info
,
0
);
}
void
CpuMatrix
::
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
size_t
channels
,
size_t
sizeX
,
size_t
sizeY
,
size_t
strideH
,
size_t
strideW
,
size_t
outputH
,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
)
{
maxPoolForward
(
inputMat
,
imgSizeH
,
imgSizeW
,
channels
,
sizeX
,
sizeY
,
strideH
,
strideW
,
outputH
,
outputW
,
paddingH
,
paddingW
,
NULL
,
false
);
}
void
CpuMatrix
::
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
...
...
@@ -2041,8 +1983,7 @@ void CpuMatrix::maxPoolForward(Matrix& inputMat,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
,
MatrixPtr
maskMatP
,
bool
withMask
)
{
MatrixPtr
maskMatP
)
{
real
*
inputData
=
inputMat
.
getData
();
real
*
outData
=
data_
;
real
*
maskData
=
NULL
;
...
...
@@ -2054,7 +1995,7 @@ void CpuMatrix::maxPoolForward(Matrix& inputMat,
CHECK_EQ
(
channels
*
outLength
,
this
->
getWidth
());
size_t
outStride
=
getStride
();
if
(
withMask
)
{
if
(
maskMatP
!=
NULL
)
{
maskData
=
maskMatP
->
getData
();
CHECK_EQ
(
channels
*
outLength
,
maskMatP
->
getWidth
());
}
...
...
@@ -2080,7 +2021,7 @@ void CpuMatrix::maxPoolForward(Matrix& inputMat,
int
wstart
=
pw
*
strideW
-
paddingW
;
int
wend
=
std
::
min
(
wstart
+
sizeX
,
imgSizeW
);
wstart
=
std
::
max
(
wstart
,
0
);
if
(
!
withMask
)
{
if
(
maskMatP
==
NULL
)
{
for
(
int
h
=
hstart
;
h
<
hend
;
++
h
)
{
for
(
int
w
=
wstart
;
w
<
wend
;
++
w
)
{
outData
[
ph
*
outputW
+
pw
]
=
std
::
max
(
...
...
@@ -2103,7 +2044,7 @@ void CpuMatrix::maxPoolForward(Matrix& inputMat,
inputData
+=
inLength
;
outData
+=
outLength
;
if
(
withMask
)
maskData
+=
outLength
;
if
(
maskMatP
!=
NULL
)
maskData
+=
outLength
;
}
}
}
...
...
paddle/math/Matrix.h
浏览文件 @
a54565ea
...
...
@@ -861,26 +861,7 @@ public:
/**
* Pooling forward operation, pick out the largest element
* in the sizeX of value.
*/
virtual
void
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
size_t
channels
,
size_t
sizeX
,
size_t
sizeY
,
size_t
strideH
,
size_t
strideW
,
size_t
outputH
,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
)
{
LOG
(
FATAL
)
<<
"Not implemeted"
;
}
/**
* Pooling forward operation, pick out the largest element
* in the sizeX of value, if set withMask true, it will
* in the sizeX of value, if the maskMatP is not NULL, it will
* also caculate the location indices.
*/
virtual
void
maxPoolForward
(
Matrix
&
inputMat
,
...
...
@@ -895,8 +876,7 @@ public:
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
,
MatrixPtr
maskMatP
,
bool
withMask
)
{
MatrixPtr
maskMatP
=
NULL
)
{
LOG
(
FATAL
)
<<
"Not implemeted"
;
}
...
...
@@ -1437,19 +1417,6 @@ public:
void
classificationError
(
Matrix
&
output
,
IVector
&
label
,
size_t
topkSize
=
1
);
void
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
size_t
channels
,
size_t
sizeX
,
size_t
sizeY
,
size_t
strideH
,
size_t
strideW
,
size_t
outputH
,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
);
void
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
...
...
@@ -1462,8 +1429,7 @@ public:
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
,
MatrixPtr
maskMatP
,
bool
withMask
);
MatrixPtr
maskMatP
);
void
maxPoolBackward
(
Matrix
&
image
,
size_t
imgSizeH
,
...
...
@@ -1723,19 +1689,6 @@ public:
MatrixPtr
clone
(
size_t
height
,
size_t
width
,
bool
useGpu
=
false
);
void
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
size_t
channels
,
size_t
sizeX
,
size_t
sizeY
,
size_t
strideH
,
size_t
strideW
,
size_t
outputH
,
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
);
void
maxPoolForward
(
Matrix
&
inputMat
,
size_t
imgSizeH
,
size_t
imgSizeW
,
...
...
@@ -1748,8 +1701,7 @@ public:
size_t
outputW
,
size_t
paddingH
,
size_t
paddingW
,
MatrixPtr
maskMatP
,
bool
withMask
);
MatrixPtr
maskMatP
);
void
maxPoolBackward
(
Matrix
&
image
,
size_t
imgSizeH
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录