generative deep learning stochasticity is good to induce robustness because gan training results in dynamic equilibriumgans are likely to get stuck in all sorts of ways introducing randomness during training helps prevent this we introduce randomness in two waysby using dropout in the discriminator and by adding random noise to the labels for the discriminator sparse gradients can hinder gan training in deep learningsparsity is often desirable propertybut not in gans two things can induce gradient sparsitymax pooling operations and relu activations instead of max poolingwe recommend using strided convolutions for downsamplingand we recommend using leakyrelu layer instead of relu activation it' similar to relubut it relaxes sparsity constraints by allowing small negative activation values in generated imagesit' common to see checkerboard artifacts caused by unequal coverage of the pixel space in the generator (see figure to fix thiswe use kernel size that' divisible by the stride size whenever we use strided conv dtranpose or conv in both the generator and the discriminator figure checkerboard art ifacts caused by mismat ching strides and kernel sizesresult ing in unequal pixel-space coverageone of he many got chas of gans the generator firstlet' develop generator model that turns vector (from the latent space-during training it will be sampled at randominto candidate image one of the many issues that commonly arise with gans is that the generator gets stuck with generated images that look like noise possible solution is to use dropout on both the discriminator and the generator listing gan generat or net work import keras from keras import layers import numpy as np latent_dim height width channels licensed to