GANS' (Generative Adversarial Networks) Flashcards

1
Q

Cool uses for GANS

A
  1. create an imaginary photo of a bird based on a textual description 2. create an imaginary photo based on a hand drawing(Adobe) 3. Blueprints of buildings can be turned into finished buildings 4. Turn photo of face into a cartoon of a face(Facebook) 5. Turn photo of day scene into night scene(Nvidia) 6. Turn video of horse into a zebra(Berkley, CycleGan) 7. Simulated Training Set - Take 3D rendered images of eyes, turn into more realistic versions, then use these versions for training set to make predictions of where user is looking(Apple) 8. Imitation Learning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Basic Structure of GAN’s

A
  • Model Inputs (Noise Vector Z and Real Images)
  • Generator
  • Discriminator
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to create the Generator Inputs in TF

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you train a GAN

A

Show a lot of images and ask to create an image from same probability distribution. This is unsupervised learning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the training code for a GAN

A
  1. Build Models (Discriminator & Generator)
  2. Use Models to calculate Model Loss
  3. Optimize Model Loss
  4. Setup session, initalize global variables, start epochs
  5. Get real images and scale them
  6. Get random noise vector with appropriate distribution
  7. Run optimizers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe code to run optimizers

A

_ = sess.run(d_opt, feed_dict={input_real: batch_images, input_z: batch_z, lr: learning_rate})
_ = sess.run(g_opt, feed_dict={input_real: batch_images, input_z: batch_z, lr: learning_rate})

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe How to create a Generator

A
  1. Take Input Noise Tensor and create a fully connected layer
    1. with tf.variable_scope(‘generator’, reuse= not is_train):
      x1 = tf.layers.dense(z, 2*2*512)
  2. Reshape the tensor to start a convolutional stack
    1. x1 = tf.reshape(x1, (-1, 2,2,512))
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe what the output of the generator is and how it should be shaped

A

The output is an image which is handed to the discriminator. It must be the same size as the real images that are being fed to the discriminator outside of the generator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The input noise vector z, which is fed to the generator, where is this established?

A
  • In the training code
  • batch_z = np.random.uniform(-1, 1, size=(batch_size, z_dim)
  • np.random.uniform parameters = (low, high, size/output shape)
  • output shape is calculated by multiplying inputs provided and this is the amount of samples drawn. So it would be 64 * 100 is my example
  • batch_size and z_dim are hyperparameters
  • Uniform = Equally likely
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe why we use a variable scope when creating a discriminator and generator

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly