Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3DPoolingLayer #3504

Merged
merged 9 commits into from
Aug 31, 2017
Merged

Conversation

chengduoZH
Copy link
Contributor

@chengduoZH chengduoZH commented Aug 15, 2017

fix #438
Add 3DPoolingLayer.

  • CPU implementation.
  • GPU implementation.
  • Add unit test.
  • Add maxPoolIdx
  • Add config parser for pooling3D

@chengduoZH
Copy link
Contributor Author

Start from "Add Pool3DLayer"

@chengduoZH chengduoZH force-pushed the Add_3DPooling branch 3 times, most recently from 6e70deb to c5d0439 Compare August 18, 2017 10:24
@qingqing01
Copy link
Contributor

Please remove 3DConv/3D-DeConv in this PR at first.

* @param[out] tgtData output data.
* @param[in] tgtStride stride between output data samples.
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments, since the following argument names are clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
if (imgSizeW_ == 0) {
// imgSizeW_ = imgSize_;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these codes are out of use, please remove them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

size_t paddingD,
size_t paddingH,
size_t paddingW) {
CHECK(inputMat.useGpu_ == true) << "Matrix type are not equal";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK(inputMat.useGpu_) << "Matrix type is not correct";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

size_t paddingH,
size_t paddingW) {
CHECK(inputMat.useGpu_ == true && outGrad.useGpu_ == true &&
outV.useGpu_ == true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK(inputMat.useGpu_  && outGrad.useGpu_  && outV.useGpu_)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

size_t paddingD,
size_t paddingH,
size_t paddingW) {
CHECK(inputMat.useGpu_ == true) << "Matrix type are not equal";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

outputH_,
outputW_,
1,
1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -1506,6 +1670,82 @@ class CpuMatrix : public Matrix {
real scaleOutput,
size_t paddingH,
size_t paddingW);
//////////////////////
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

real scaleOutput,
size_t paddingD,
size_t paddingH,
size_t paddingW);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

虽然无关紧要,但是这些参数的顺序稍乱, 尤其把real scaleTargets, real scaleOutput莫名的插在中间~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


cpuImage->randomizeUniform();
gpuImage->copyFrom(*cpuImage);
// std::cout << "test maxPool3DForward...\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

TEST(Matrix, Pool3D) {
for (auto depth : {9, 16, 64, 128}) {
for (auto height : {9, 11, 128, 256}) {
for (auto width : {9, 32, 128}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

减少测试case~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@chengduoZH chengduoZH force-pushed the Add_3DPooling branch 7 times, most recently from c836000 to b1c0bad Compare August 30, 2017 05:20
qingqing01
qingqing01 previously approved these changes Aug 30, 2017
qingqing01
qingqing01 previously approved these changes Aug 31, 2017
@chengduoZH chengduoZH merged commit fcad0a3 into PaddlePaddle:develop Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support 3-Dimensional Pooling.
2 participants