-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
output shape deconv2d #3824
Comments
I my previous tests a few months ago I could only get a deep deconv net to work on Tensorflow. I do think there might be some edge cases in the shape inference, specially in the theano side. I started working to get Spatial Transformers up here in the main branch. Maybe somebody else could check that out meanwhile? |
Because it seems many corner cases exist and because we need to pass an output shape, is it ok to just bypass this calculation? |
@tboquet : I myself am struggling to understand the math behind Deconv2D, so I might be wrong. But here are some of my observations.
Any thoughts? |
@yaringal wrote this. Would check this out if you have some time? |
@dolaameng weird, the code I posted works for both tensorflow and theano on my side. |
@tboquet : sorry for not being clear enough. What I meant was for the |
Ah yep! Let's wait for @yaringal suggestions 😃 ! |
Apologies for not responding - I'm currently writing up and won't have time to help until the end of the month... Like what @dolaameng said, the output shape is not arbitrary but calculated based on the input shape and filter size / padding / stride. From memory Theano didn't have a proper documentation for the calculation of the output shape, and I ended up borrowing one from Lasagne (as written in the doc string for The way we ended up using this layer in practice for our project was feeding a dummy input and observing the true output from the deconv layer. We then used the shape of the true output as the input shape to the deconv layer. Following this we built a deep conv-deconv autoencoder with multiple layers. A proper way to do this would be to infer the shape following the implementation in Theano, but this is quite difficult because Theano expects a scalar input for the shape rather than a symbolic variable. @lukovkin started working on this here yaringal#4. |
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
Hi all,
I wonder if
get_output_shape_for
in Deconv2d is right in all cases.For some filter's shapes and border modes it differs from the true shape. I just started using deconvolution so my understanding of the arithmetic, the implementation in Theano\Tensorflow, and how the shape inference works in Keras is maybe wrong but it seems the behavior is not the same.
#3540 is also related and maybe you guys @EderSantana, @lukovkin and @dolaameng can help!
With theano:
Output GPU:
Output CPU:
With TensorFlow:
Output GPU:
I don't have a Tensorflow cpu setup so if someone is willing to test this on cpu it would be interesting to compare the results.
Tx!
The text was updated successfully, but these errors were encountered: