<p>for 1) i do not think there is a reason for the number of dense nodes used (128x16x16), however the 16x16 is set because you only have 1 layer to up sample 16x16 to 32x32.</p>

<p>for 2) the first argument <code>256</code> used to instantiate <a href="https://keras.io/layers/convolutional/" rel="nofollow noreferrer"><code>Conv2D</code></a> defines the number of filters.</p>

<p>In regards to your last question <code>Next, run another Conv2DTranspose and then another 3 Conv2d. Why?!</code>  I would recommend try increasing/decreasing the number of layers to get a feel on how the model behaves with those changes (performing better or not), this is part of the "<a href="https://arxiv.org/abs/1206.5533" rel="nofollow noreferrer">hyper-parameter tuning</a>" process when building a neural net.</p>

<p>Hope the above helps.</p>
How to decide how many convolutions e deconvolutions apply to a GAN?
<p>I'm trying to understand how the adversarial generative network works: I found an example in the book by François Chollet (Deep learning with Python) in which there is an example of a GAN he uses CIFAR10 dataset, using the 'frog' class which contains 32x32 RGB images.</p>

<p>I can't understand why:</p>

<ul>
<li>In (1) the input is transformed into 16 × 16 128-channel (why 128-channel?) feature map</li>
<li>In (2) when a convolution is performed, with which filter? It is not specified</li>
</ul>

<p>Next, run another Conv2DTranspose and then another 3 Conv2d. Why?!</p>

<p>At the end, I have a 32 × 32 1-channel feature map.</p>

<pre><code>from keras import layers
import numpy as np
latent_dim = 32
height = 32
width = 32
channels = 3

generator_input = keras.Input(shape=(latent_dim,))

(1)
x = layers.Dense(128 * 16 * 16)(generator_input)
x = layers.LeakyReLU()(x)
x = layers.Reshape((16, 16, 128))(x)

(2)
x = layers.Conv2D(256, 5, padding='same')(x)
x = layers.LeakyReLU()(x)

x = layers.Conv2DTranspose(256, 4, strides=2, padding='same')(x)
x = layers.LeakyReLU()(x)

x = layers.Conv2D(256, 5, padding='same')(x)
x = layers.LeakyReLU()(x)
x = layers.Conv2D(256, 5, padding='same')(x)
x = layers.LeakyReLU()(x)

x = layers.Conv2D(channels, 7, activation='tanh', padding='same')(x)
generator = keras.models.Model(generator_input, x)
generator.summary()
</code></pre>