10
$\begingroup$

I am working with generative adversarial networks (GANs) and one of my aims at the moment is to reproduce samples in two dimensions that are distributed according to a circle (see animation). When using a GAN with small networks (3 layers with 50 neurons each), the results are more stable than with bigger layers (3 layers with 500 neurons each). All other hyperparameters are the same (see details of my implementation below).

I am wondering if anyone has an explanation for why this is the case. I could obviously try to tune the other hyperparameters to get good performance but would be interested in knowing if someone has heuristics about what is needed to change whenever I change the size of the networks.

GAN with smaller layer size reproduces the original samples better


Network/Training parameters

I use PyTorch with the following settings for the GAN:

Networks:

  • Generator/Discriminator Architecture (all dense layers): 100-50-50-50-2 (small); 100-500-500-500-2 (big)
  • Dropout: p=0.4 for generator (except last layer), p=0 for discriminator
  • Activation functions: LeakyReLU (slope 0.1)

Training:

  • Optimizer: Adam
  • Learning Rate: 1e-5 (for both networks)
  • Beta1, Beta2: 0.9, 0.999
  • Batch size: 50
$\endgroup$
4
  • $\begingroup$ How many data points did you used? Maybe increasing dataset n times reduces this effect. $\endgroup$
    – Enes
    Jan 26, 2021 at 9:16
  • $\begingroup$ I use 100k data points in total for training. With a batch size of 50, that's 2000 updates for each epoch, and I have 600 epochs. I think 100k is big enough so that increasing it shouldn't change too much. $\endgroup$
    – Mafu
    Jan 26, 2021 at 9:28
  • $\begingroup$ Maybe the bigger network is perceiving more random noise and replicating it better. Just to be sure, I'd take it easy with the dropout and/or increase the batch size. $\endgroup$ Aug 17, 2021 at 19:25
  • $\begingroup$ Generally I think I agree with Andre above. Out of curiosity, have you tried increasing the number of layers instead of increasing the number of neurons in each layer? $\endgroup$
    – hH1sG0n3
    Apr 20 at 14:23

1 Answer 1

1
$\begingroup$

Variance

What it seems to be taking place here is a form of overfitting. Specifically when using larger layers, the model may become too complex and start to fit the noise in the training data, rather than the underlying patterns. This can lead to poor generalization performance and, as seen here unstable behavior.

Other

Other complexities that may arise when using larger layers is diversity issues. Specifically, more complex GAN models may produce less diverse output from the generator, as the network is prone to get stuck in a particular mode of the data distribution and fail to explore other areas.

To address this issue, regularisation techniques such as dropout or noise introduction can be deployed to encourage the generator to produce more diverse output. Additionally modifying the loss function can encourage the generator to explore different modes of the data distribution.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .