Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Asymmetric Padding support in MXNet #13569

Open
ChaiBapchya opened this issue Dec 7, 2018 · 4 comments
Open

Asymmetric Padding support in MXNet #13569

ChaiBapchya opened this issue Dec 7, 2018 · 4 comments

Comments

@ChaiBapchya
Copy link
Contributor

ChaiBapchya commented Dec 7, 2018

Problem

Feature request for "Asymmetric padding"
Currently, MXNet supports Symmetric padding
e.g.

Input data -> 1,2,3,4 and pad=2
Output data -> 0,0,1,2,3,4,0,0

Why isn't Asymmetric padding supported by CUDnn, MXNet?

Due to misalignment of input-output if padding happens only on one side (left or right alone).
It is called as "Causal Convolution" (only one side pad)

Current work-around

Level of abstraction introduced.
By default, one can use pad parameter while performing Pooling or Convolution which performs symmetric padding. But, if there is a specific use-case for performing asymmetric padding, one has to perform following steps,
Perform independent padding (using pad operator) and then perform Pooling or Convolution as desired.

Future steps

If one has to fully implement asymmetric padding, following changes need to be made

Pooling

Add another parameter such as pad_type (because currently, pooling_conv which allows - 'full', 'valid', 'same' has been misused. Original meaning of pooling_conv was not supposed to take care of "type of padding"

Convolution

Incorporate asymmetric padding for the same

Reference

PR #12594 that supports MaxPool 1D with "same" padding

@ChaiBapchya
Copy link
Contributor Author

@mxnet-label-bot add [Operator, Feature request]

@marcoabreu
Copy link
Contributor

I think we had this request due to onnx and it got implemented somewhere

@nswamy (don't have roshanis handle memorized)

@apeforest
Copy link
Contributor

@Roshrini Do you know if this feature already exists for onnx?

@Roshrini
Copy link
Member

@apeforest No this feature does not exist yet. We use the work around mentioned by Chaintanya (Using pad op with pooling)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants