We proceed with the recipe as follows:
- Clone the code from github:
git clone https://github.com/TengdaHan/GAN-TensorFlow
- Define a Xavier initializer as described in the paper Understanding the difficulty of training deep feedforward neural networks (2009) by Xavier Glorot, Yoshua Bengio, http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.207.2059&rep=rep1&type=pdf The initializers are proven to allow better convergence for GANs:
def xavier_init(size): in_dim = size[0] xavier_stddev = 1. / tf.sqrt(in_dim / 2.) return xavier_stddev
- Define the generator for the input X. First we define a matrix W1 with the dimension [100, K=128], initialized according to a normal distribution. Note that 100 is an arbitrary value for ...