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 dilation for exconv layer #5165

Merged
merged 14 commits into from
Nov 14, 2017
Merged

Add dilation for exconv layer #5165

merged 14 commits into from
Nov 14, 2017

Conversation

NHZlX
Copy link
Contributor

@NHZlX NHZlX commented Oct 27, 2017

fix #5164
fix #5242

@NHZlX NHZlX requested review from Xreki and hedaoyuan October 27, 2017 13:37
@NHZlX NHZlX changed the title Add dilation Add dilation for exconv layer Oct 27, 2017
batchSize > 1 && stride > 1)
break;
if ((conv1 == "NaiveConv-CPU" || conv2 == "NaiveConv-CPU") &&
dilation > 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

The NNPACKConv also does not support dilation.

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

@@ -79,45 +79,54 @@ void Convolution(const std::string& conv1,
if (outputChannels < inputChannels) continue;
for (size_t stride : {1, 2}) {
for (size_t padding : {0, 1}) {
if (padding >= filterSize) break;
for (size_t dilation : {1, 3}) {
if (padding >= filterSize) break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why here do not need some checking like in the 'Im2ColTest.cpp? filterSizemultiplied bydilationmay be greater thaninputSize`.

                  size_t filterSizeH = (filterHeight - 1) * dilation + 1;
                  size_t filterSizeW = (filterWidth - 1) * dilation + 1;
                  if (inputHeight <= filterSizeH || inputWidth <= filterSizeW)
                    break;
                  if (padding >= filterSizeH || padding >= filterSizeW) break;
                  size_t outputHeight =
                      (inputHeight - filterSizeH + 2 * padding) / stride + 1;
                  size_t outputWidth =
                      (inputWidth - filterSizeW + 2 * padding) / stride + 1;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I add the control to it, the inputSize + 2 * padding < filterS.

@NHZlX NHZlX merged commit d7319c2 into PaddlePaddle:develop Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

cnn_output_size Calculation error using dilation in python api need dilation support for exconv layer
2 participants