-
Notifications
You must be signed in to change notification settings - Fork 74.7k
Transpose convolution layer for tensorflow (was deconvolution) #256
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
Comments
It's here:
Not sure why it's not exposed in the documentation yet, possibly because the API isn't considered stable. |
Cool, thanks for pointing me there! |
|
"deconvolution" has been used as a synonym for transposed convolution in recent computer vision literature, especially in ConvNet related work. I believe this "deconv2d" is exactly the op most people will be using for either upsampling or visualization purposes. |
@vincentvanhoucke: I'm happy to expose it in the public API as long as we're fine with the misleading name. |
@girving I remember being very, very confused when the term 'deconvolution' started popping up in the literature for this operator. I blame Matt (Zeiler) ;-) I had to go back to his papers to convince myself of what they were doing and that it had nothing to do with actually deconvolving the input. Since 'deconv' is apparently here to stay, should we consider making the name a bit more explicit? On the table from my POV: Note that I actually don't know what an alternative 'deconv2d' might look like. The process of deconvolving an input is ill-posed and there are many ways to go about it, so it's possible that option 3 is just fine as long as there is an abundance of documentation. @shlens and @josh11b might have opinions on the matter. |
Another option is 'convt' (short for convolution transpose), which is adopted by matconvnet. |
I think |
conv2d_transpose SGTM, it would put it jut after conv2d in alphabetical ordering. We should emphasize in the doc that it's what's often referred as 'deconv' or 'deconvolution', so that it shows up if anyone searches the docs for those terms. |
The current implementation crashes the Python kernel when given an output shape with a -1 in the first dimension. It would be helpful to throw a Python error and document this limitation, as ops produced by similar functions (eg conv2d) handle the scenario just fine. |
@jeffschecter: What kind of error do you get with the kernel crash? This may be the same thing as #449, in which case it's fixed in 5de9085 and will be part of 0.6.0 soon. That is, it should still generate exceptions, but will no longer crash the process. |
@jeffschecter: Oops, no, it's an independent bug. I'll fix that now. Thanks for the catch. |
There are many algorithms to deconvolve an image. For easier extensibility in the future and to avoid being locked in a specific implementation, the public API should add a parameter to reflect which method is used and call the corresponding internal function. https://reference.wolfram.com/language/ref/ImageDeconvolve.html |
@futurely: I'm not sure what you mean by those references, since they are to actual deconvolution ops. There are many ways to perform deconvolution, but the transpose of convolution is not one of them. |
For example, if blind deconvolution is implemented too, users can switch between different deconvolution algorithm with the following code. It's stylistic difference but may be a bit easier to use than to change potentially multiple occurrences of method = 'blind'
# method = 'transpose'
deconv2d(..., method = method) |
@futurely: Feature requests about deconvolution should go in a separate issue. This thread is about the transpose of convolution, which is unrelated. |
The transpose-convolution operator already exists in TF, I think it is one of the conv_2d_backprop_*() functions. If we were to give it another name as part of exposing it in the api, I'd prefer conv_2d_transpose or some such and having documentation that some sources mistakenly refer to that op as deconvolution. I think we should not contribute to the misuse of the deconvolution term -- it leads to things like futurely@'s confusion. |
Yep, Vincent and I agreed on |
How do you use deconv2d for upsampling? |
@ry: Questions like that are better suited to stackoverflow. This thread should stay focused on the missing |
Add a canonicalizer for `spirv::LogicalNotOp`. Converts: * spv.LogicalNot(spv.IEqual(...)) -> spv.INotEqual(...) * spv.LogicalNot(spv.INotEqual(...)) -> spv.IEqual(...) * spv.LogicalNot(spv.LogicalEqual(...)) -> spv.LogicalNotEqual(...) * spv.LogicalNot(spv.LogicalNotEqual(...)) -> spv.LogicalEqual(...) Also moved the test for spv.IMul to arithemtic tests. Closes #256 COPYBARA_INTEGRATE_REVIEW=tensorflow/mlir#256 from denis0x0D:sandbox/canon_logical_not 76ab5787b2c777f948c8978db061d99e76453d44 PiperOrigin-RevId: 282012356 Change-Id: I60413fae31379a55a90093b23b810309810f3725
from my understanding, it should be called as "inverse convolution" instead of "transpose convolution". here x is input (layer), A is kernel, b is output (layer) |
Has anyone already started implementing a deconvolutional layer for tensorflow as it's used e. g. here https://github.com/stokasto/caffe ? Is anyone else interested in such a functionality or is there any trivial way to implement this using the existing tensors?
The text was updated successfully, but these errors were encountered: