-
Notifications
You must be signed in to change notification settings - Fork 2.5k
deconvolution interface #3872
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
deconvolution interface #3872
Conversation
@dwf, since you opened the original issue, your feedback would be welcome. |
input. Generates output of shape: input shape - filter shape + 1 | ||
* ``'full'``: apply filter wherever it partly overlaps with the input. | ||
Generates output of shape: input shape + filter shape - 1 | ||
* ``'half'``: pad input with a symmetric border of ``filter rows // 2`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "traditional" border modes are usually full
, valid
and same
(see e.g. matlab's conv).
I suggest to implement same
, maybe in place of half
which seems almost the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just add the 'same' mode, but maybe as part of another PR.
This is just exposing an interface and "half" is already there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
is tricky, because it may mean uneven padding on both sides, which is not implemented in some back-ends (if not all), or taking a subtensor (which makes the tensor non-contiguous).
This is why we have half
, which is equivalent to same
when same
is achievable with symmetric padding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that, let's stick with half
then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should add 'same', but not in this PR.
Pascal and I checked Zeiler's deconvolutional networks papers (https://www.cs.nyu.edu/~gwtaylor/publications/zeilertaylorfergus_iccv2011.pdf, http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf). Apparently, what they do is using alternating layers of convolutional sparse coding instead of taking the gradient of conv outputs w.r.t its inputs. |
So, the discussion at TensorFlow for this functionality is at tensorflow/tensorflow#256. Interesting points:
TensorFlow settled on For the moment, I would be OK with merging this PR, and open a new ticket to add a |
used by the convolution, such that the output_grad is upsampled | ||
to the input shape. | ||
|
||
:type output_grad: symbolic 4D tensor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's quite confusing to call the input of the function output_grad
. I understand why it was called like this, but probably something like input_tensor
or 'to_be_upsampled_tensor' would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep output_grad
here for now.
OK, so we agreed with @vdumoulin, @fvisin, and @nouiz to have a |
So in the end, there is only one small change, and then we can merge. Thanks! |
I applied the change. |
Thanks! |
PR for issue #3681