July 2019
Intermediate to advanced
512 pages
19h 39m
English
Generator
takes the noise
as an input and returns an image. We define the generator as a feedforward network with three layers. Instead of coding the generator network from scratch, we can use tf.layers.dense(), which can be used to create a dense layer. It takes three parameters: inputs, the number of units, and the activation function:
def generator(z,reuse=None): with tf.variable_scope('generator',reuse=reuse): hidden1 = tf.layers.dense(inputs=z,units=128,activation=tf.nn.leaky_relu) hidden2 = tf.layers.dense(inputs=hidden1,units=128,activation=tf.nn.leaky_relu) ...Read now
Unlock full access