1

When using tf.layers.conv2d_transpose what defines the output tensor shape?

For example: if the input was 4x4x512, for the output to be 8x8x256 the filters can be given, but how are is the height and width defined? Or else is it always two times the input height and width?

Thanks.

mirantha
  • 21
  • 1
  • 4
  • 1
    What have you tried to achieve your wanted results? What has your research concerning your problem shown? Can you provide code of your tries? [How do I ask a good question](//stackoverflow.com/help/how-to-ask), [How much research effort is expected](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users), and [How to create a Minimal, Complete, and Verifiable example](//stackoverflow.com/help/mcve) might be helpful to improve your question. – peacetype Feb 25 '18 at 05:36
  • I want to use tf.layers.conv2d_transpose in the generator funtion of a GAN. – mirantha Feb 25 '18 at 05:39

1 Answers1

0

Check this answer it provides a formula that answers your question. https://stackoverflow.com/a/43624992/7431458

From the above it is the stride, padding, kernel shape and input shape that defines the output shape. You also have to set the output shape parameter to let Tensorflow know what the intended shape is because of some side cases mentioned in the above link.

For better explanation of what transpose convolution does check here:

https://towardsdatascience.com/types-of-convolutions-in-deep-learning-717013397f4d

Burton2000
  • 1,972
  • 13
  • 23
  • Thank you very much for this info! The blog post was really useful and cleared a lot of grey areas I had. Thanks again! – mirantha Feb 25 '18 at 16:08