title: How to make the decoder output shape be equal to the input image shape?
body: <p>I am trying to find out that: <code>decoder.output_shape[1:]==IMG_SHAPE</code>.</p>
  
  <p>I have the following function which I have programmed. When I try to run <code>decoder.output_shape[1:]==IMG_SHAPE</code>, I find that my image shape and my decoder output shape are not the same. </p>
  
  <pre><code>def build_deep_autoencoder(img_shape, code_size):
      """PCA's deeper brother."""
      H,W,C = img_shape
  
      # encoder
      encoder = keras.models.Sequential()
      encoder.add(L.InputLayer(img_shape))
  
      # numbers of output channels: 32, 64, 128, 256.
      encoder.add(L.Conv2D(filters=32, kernel_size=(3, 3), padding='same', activation='elu'))
      encoder.add(L.MaxPooling2D())
  
      encoder.add(L.Conv2D(filters=64, kernel_size=(3, 3), padding='same', activation='elu'))
      encoder.add(L.MaxPooling2D())
  
      encoder.add(L.Conv2D(filters=128, kernel_size=(3, 3), padding='same', activation='elu'))
      encoder.add(L.MaxPooling2D())
  
      encoder.add(L.Conv2D(filters=256, kernel_size=(3, 3), padding='same', activation='elu'))
      encoder.add(L.MaxPooling2D())
  
      encoder.add(L.Flatten())                  #flatten image to vector
      encoder.add(L.Dense(code_size, activation = 'elu')) 
  
  
      # decoder
      decoder = keras.models.Sequential()
      decoder.add(L.InputLayer((code_size,)))
  
      # numbers of output channels: 128, 64, 32, 3.
      decoder.add(L.Dense(np.prod(img_shape), activation = 'elu'))  #actual decoder, height*width*3 units
      decoder.add(L.Reshape(img_shape))         #un-flatten
  
      decoder.add(L.Conv2DTranspose(filters=128, kernel_size=(3, 3), strides=2, activation='elu', padding='same'))
  
      decoder.add(Conv2DTranspose(filters=64, kernel_size=(3, 3), strides=2, activation='elu', padding='same'))
  
      decoder.add(L.Conv2DTranspose(filters=32, kernel_size=(3, 3), strides=2, activation='elu', padding='same'))
  
      decoder.add(L.Conv2DTranspose(filters=3, kernel_size=(3, 3), strides=2, activation=None, padding='same'))
  
  
      return encoder, decoder
  </code></pre>
  
  <p>Note that <code>code_size=32</code>.</p>
  
  <p>I expect the output of <code>decoder.output_shape[1:]==IMG_SHAPE</code> to be <code>True</code>, but the actual output is <code>False</code>.</p>