8000 deconvolution interface by SinaHonari · Pull Request #3872 · Theano/Theano · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 5 commits into from
Feb 3, 2016
Merged

deconvolution interface #3872

merged 5 commits into from
Feb 3, 2016

Conversation

SinaHonari
Copy link
Contributor

PR for issue #3681

@lamblin
Copy link
Member
lamblin commented Jan 14, 2016

@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``
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@SinaHonari
Copy link
Contributor Author

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.

@lamblin
Copy link
Member
lamblin commented Jan 25, 2016

So, the discussion at TensorFlow for this functionality is at tensorflow/tensorflow#256. Interesting points:

  • Matt Zeiler calls the entire stack Deconvolution Networks, but only ever refers to this operator as a 'projection operator'
  • Caffe calls it Deconvolution

TensorFlow settled on conv2d_transpose, in addition to the underlying conv2d_backprop_input.
Maybe it would make sense to also add an alias with that name, that would also be consistent with the class in Blocks (https://github.com/mila-udem/blocks/blob/master/blocks/bricks/conv.py#L183-L235).

For the moment, I would be OK with merging this PR, and open a new ticket to add a conv2d_transpose later. Is that OK for you @nouiz @dwf @vdumoulin @abergeron ?

used by the convolution, such that the output_grad is upsampled
to the input shape.

:type output_grad: symbolic 4D tensor.
Copy link
Member

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.

Copy link
Member

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.

@lamblin
Copy link
Member
lamblin commented Feb 3, 2016

OK, so we agreed with @vdumoulin, @fvisin, and @nouiz to have a conv2d_transpose later. So for now I'm going to comment the last points that need to be addressed for that PR, and then I'll merge when they are addressed.

@lamblin
Copy link
Member
lamblin commented Feb 3, 2016

So in the end, there is only one small change, and then we can merge. Thanks!

@SinaHonari
Copy link
Contributor Author

I applied the change.

@lamblin
Copy link
Member
lamblin commented Feb 3, 2016

Thanks!

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.

6 participants
0