Face Generation

In this project, you'll use generative adversarial networks to generate new images of faces.

Get the Data

You'll be using two datasets in this project:

  • MNIST
  • CelebA

Since the celebA dataset is complex and you're doing GANs in a project for the first time, we want you to test your neural network on MNIST before CelebA. Running the GANs on MNIST will allow you to see how well your model trains sooner.

If you're using FloydHub, set data_dir to "/input" and use the FloydHub data ID "R5KrjnANiKVhLWAkpXhNBe".


In [7]:
data_dir = './data'

# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
#data_dir = '/input'


"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper

helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)


Found mnist Data
Found celeba Data

Explore the Data

MNIST

As you're aware, the MNIST dataset contains images of handwritten digits. You can view the first number of examples by changing show_n_images.


In [8]:
show_n_images = 25

"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
%matplotlib inline
import os
from glob import glob
from matplotlib import pyplot

mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'mnist/*.jpg'))[:show_n_images], 28, 28, 'L')
pyplot.imshow(helper.images_square_grid(mnist_images, 'L'), cmap='gray')


Out[8]:
<matplotlib.image.AxesImage at 0x7fd3f4574160>

CelebA

The CelebFaces Attributes Dataset (CelebA) dataset contains over 200,000 celebrity images with annotations. Since you're going to be generating faces, you won't need the annotations. You can view the first number of examples by changing show_n_images.


In [9]:
show_n_images = 25

"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'img_align_celeba/*.jpg'))[:show_n_images], 28, 28, 'RGB')
pyplot.imshow(helper.images_square_grid(mnist_images, 'RGB'))


Out[9]:
<matplotlib.image.AxesImage at 0x7fd3f48bd668>

Preprocess the Data

Since the project's main focus is on building the GANs, we'll preprocess the data for you. The values of the MNIST and CelebA dataset will be in the range of -0.5 to 0.5 of 28x28 dimensional images. The CelebA images will be cropped to remove parts of the image that don't include a face, then resized down to 28x28.

The MNIST images are black and white images with a single color channel while the CelebA images have 3 color channels (RGB color channel).

Build the Neural Network

You'll build the components necessary to build a GANs by implementing the following functions below:

  • model_inputs
  • discriminator
  • generator
  • model_loss
  • model_opt
  • train

Check the Version of TensorFlow and Access to GPU

This will check to make sure you have the correct version of TensorFlow and access to a GPU


In [10]:
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
from distutils.version import LooseVersion
import warnings
import tensorflow as tf

# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer.  You are using {}'.format(tf.__version__)
print('TensorFlow Version: {}'.format(tf.__version__))

# Check for a GPU
if not tf.test.gpu_device_name():
    warnings.warn('No GPU found. Please use a GPU to train your neural network.')
else:
    print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))


TensorFlow Version: 1.0.0
Default GPU Device: /gpu:0

Input

Implement the model_inputs function to create TF Placeholders for the Neural Network. It should create the following placeholders:

  • Real input images placeholder with rank 4 using image_width, image_height, and image_channels.
  • Z input placeholder with rank 2 using z_dim.
  • Learning rate placeholder with rank 0.

Return the placeholders in the following the tuple (tensor of real input images, tensor of z data)


In [11]:
import problem_unittests as tests

def model_inputs(image_width, image_height, image_channels, z_dim):
    """
    Create the model inputs
    :param image_width: The input image width
    :param image_height: The input image height
    :param image_channels: The number of image channels
    :param z_dim: The dimension of Z
    :return: Tuple of (tensor of real input images, tensor of z data, learning rate)
    """
    # TODO: Implement Function
    input_real = tf.placeholder(tf.float32, (None,image_width,image_height,image_channels), name='input_real')
    input_z = tf.placeholder(tf.float32,(None, z_dim), name='input_z')
    learning_rate = tf.placeholder(tf.float32, name='learning_rate')
    return input_real,  input_z, learning_rate


"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_inputs(model_inputs)


Tests Passed

In [12]:
def leaky_relu(x, alpha=0.2, name='leaky_relu'):
    return tf.maximum(x, alpha * x, name=name)

Discriminator

Implement discriminator to create a discriminator neural network that discriminates on images. This function should be able to reuse the variabes in the neural network. Use tf.variable_scope with a scope name of "discriminator" to allow the variables to be reused. The function should return a tuple of (tensor output of the generator, tensor logits of the generator).


In [24]:
def discriminator(images, reuse=False):
    """
    Create the discriminator network
    :param image: Tensor of input image(s)
    :param reuse: Boolean if the weights should be reused
    :return: Tuple of (tensor output of the discriminator, tensor logits of the discriminator)
    """
    with tf.variable_scope('discriminator', reuse=reuse):
        # TODO: Implement Function
        l = tf.layers.conv2d(images,32,5,strides=2,kernel_initializer=tf.contrib.layers.xavier_initializer(), padding='same')
        l = tf.layers.batch_normalization(l, training=True)
        l = leaky_relu(l)
        l = tf.nn.dropout(l, 0.8)
        #14 *14 *32
    
        l = tf.layers.conv2d(l,64,5,strides=2,kernel_initializer=tf.contrib.layers.xavier_initializer(),padding='same')
        l = tf.layers.batch_normalization(l, training=True)
        l = leaky_relu(l)
        l = tf.nn.dropout(l, 0.8)
        # 7 * 7 *64
        
        l = tf.layers.conv2d(l,128,5,strides=1,kernel_initializer=tf.contrib.layers.xavier_initializer(),padding='same')
        l = tf.layers.batch_normalization(l, training=True)
        l = leaky_relu(l)
        l = tf.nn.dropout(l, 0.8)
    
        # Flatten it
        flat = tf.reshape(l, (-1, 7*7*128))
        logits = tf.layers.dense(flat, 1)
        out = tf.sigmoid(logits)
    
    return out, logits


"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_discriminator(discriminator, tf)


Tests Passed

Generator

Implement generator to generate an image using z. This function should be able to reuse the variabes in the neural network. Use tf.variable_scope with a scope name of "generator" to allow the variables to be reused. The function should return the generated 28 x 28 x out_channel_dim images.


In [25]:
def generator(z, out_channel_dim,is_train=True):
    """
    Create the generator network
    :param z: Input z
    :param out_channel_dim: The number of channels in the output image
    :param is_train: Boolean if generator is being used for training
    :return: The tensor output of the generator
    """
   
    # TODO: Implement Function
    with tf.variable_scope("generator",reuse = not is_train):
        l = tf.layers.dense(z, 7*7*512)
        # Reshape it to start the convolutional stack
        l = tf.reshape(l, (-1, 7, 7,512))
        l = tf.layers.batch_normalization(l, training=is_train)
        l = leaky_relu(l)
        l = tf.nn.dropout(l, 0.5)
        # 4x4x256 now
        
        l = tf.layers.conv2d_transpose(l,256, 5, strides=2, padding='same')
        l = tf.layers.batch_normalization(l, training=is_train)
        l = leaky_relu(l)
        l = tf.nn.dropout(l, 0.5)
        # 7x7x128 now
        
        # 14x14x64 now
        l = tf.layers.conv2d_transpose(l, 128, 5, strides=2, padding='same')
        l = tf.layers.batch_normalization(l, training=is_train)
        l = leaky_relu(l)
        l = tf.nn.dropout(l, 0.5)
        # Output layer
        logits = tf.layers.conv2d_transpose(l, out_channel_dim, 5, strides=1, padding='same')
        # 28x28x3 now
        out = tf.tanh(logits)
    return out

"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_generator(generator, tf)


Tests Passed

Loss

Implement model_loss to build the GANs for training and calculate the loss. The function should return a tuple of (discriminator loss, generator loss). Use the following functions you implemented:

  • discriminator(images, reuse=False)
  • generator(z, out_channel_dim, is_train=True)

In [26]:
def model_loss(input_real, input_z, out_channel_dim):
    """
    Get the loss for the discriminator and generator
    :param input_real: Images from the real dataset
    :param input_z: Z input
    :param out_channel_dim: The number of channels in the output image
    :return: A tuple of (discriminator loss, generator loss)
    """
    # TODO: Implement Function
    g_model = generator(input_z, out_channel_dim)
    d_real,d_logits_real = discriminator(input_real)
    d_fake,d_logits_fake = discriminator(g_model,reuse=True)
    
    d_loss_real = tf.reduce_mean(
        tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real, labels=tf.ones_like(d_real) * (1 - 0.1)))
    d_loss_fake = tf.reduce_mean(
        tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.zeros_like(d_fake)))
    g_loss = tf.reduce_mean(
        tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.ones_like(d_fake)))

    d_loss = d_loss_real + d_loss_fake
    return d_loss,g_loss


"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_loss(model_loss)


Tests Passed

Optimization

Implement model_opt to create the optimization operations for the GANs. Use tf.trainable_variables to get all the trainable variables. Filter the variables with names that are in the discriminator and generator scope names. The function should return a tuple of (discriminator training operation, generator training operation).


In [27]:
def model_opt(d_loss, g_loss, learning_rate, beta1):
    """
    Get optimization operations
    :param d_loss: Discriminator loss Tensor
    :param g_loss: Generator loss Tensor
    :param learning_rate: Learning Rate Placeholder
    :param beta1: The exponential decay rate for the 1st moment in the optimizer
    :return: A tuple of (discriminator training operation, generator training operation)
    """
    # TODO: Implement Function
    t_vars = tf.trainable_variables()
    d_vars = [var for var in t_vars if var.name.startswith('discriminator')]
    g_vars = [var for var in t_vars if var.name.startswith('generator')]

     # Optimize
    with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)): 
        d_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list=d_vars)
        g_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list=g_vars)
    return  d_train_opt, g_train_opt


"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_opt(model_opt, tf)


Tests Passed

Neural Network Training

Show Output

Use this function to show the current output of the generator during training. It will help you determine how well the GANs is training.


In [28]:
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import numpy as np

def show_generator_output(sess, n_images, input_z, out_channel_dim, image_mode):
    """
    Show example output for the generator
    :param sess: TensorFlow session
    :param n_images: Number of Images to display
    :param input_z: Input Z Tensor
    :param out_channel_dim: The number of channels in the output image
    :param image_mode: The mode to use for images ("RGB" or "L")
    """
    cmap = None if image_mode == 'RGB' else 'gray'
    z_dim = input_z.get_shape().as_list()[-1]
    example_z = np.random.uniform(-1, 1, size=[n_images, z_dim])

    samples = sess.run(
        generator(input_z, out_channel_dim, False),
        feed_dict={input_z: example_z})

    images_grid = helper.images_square_grid(samples, image_mode)
    pyplot.imshow(images_grid, cmap=cmap)
    pyplot.show()

Train

Implement train to build and train the GANs. Use the following functions you implemented:

  • model_inputs(image_width, image_height, image_channels, z_dim)
  • model_loss(input_real, input_z, out_channel_dim)
  • model_opt(d_loss, g_loss, learning_rate, beta1)

Use the show_generator_output to show generator output while you train. Running show_generator_output for every batch will drastically increase training time and increase the size of the notebook. It's recommended to print the generator output every 100 batches.


In [29]:
def train(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode):
    """
    Train the GAN
    :param epoch_count: Number of epochs
    :param batch_size: Batch Size
    :param z_dim: Z dimension
    :param learning_rate: Learning Rate
    :param beta1: The exponential decay rate for the 1st moment in the optimizer
    :param get_batches: Function to get batches
    :param data_shape: Shape of the data
    :param data_image_mode: The image mode to use for images ("RGB" or "L")
    """
    # TODO: Build Model
    input_real, input_z, _  = model_inputs(data_shape[1], data_shape[2], data_shape[3], z_dim)
    
    d_loss, g_loss = model_loss(input_real, input_z, data_shape[3])
    d_opt, g_opt = model_opt(d_loss, g_loss, learning_rate, beta1)
    
    steps = 0
    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        for epoch_i in range(epoch_count):
            for batch_images in get_batches(batch_size):
                batch_images = batch_images * 2
                steps += 1
                # TODO: Train Model
                batch_z = np.random.uniform(-1, 1, size=(batch_size, z_dim))
                # Run optimizers
                _ = sess.run(d_opt, feed_dict={input_real: batch_images, input_z: batch_z})
                _ = sess.run(g_opt, feed_dict={input_z: batch_z, input_real: batch_images})
               
                if steps % 10 == 0:
                    # At the end of each epoch, get the losses and print them out
                    train_loss_d = d_loss.eval({input_z: batch_z, input_real: batch_images})
                    train_loss_g = g_loss.eval({input_z: batch_z})

                    print("Epoch {}/{}...".format(epoch_i+1, epoch_count),
                          "Discriminator Loss: {:.4f}...".format(train_loss_d),
                          "Generator Loss: {:.4f}".format(train_loss_g))
                    
                if steps % 100 == 0:
                    show_generator_output(sess, 25, input_z, data_shape[3], data_image_mode)

MNIST

Test your GANs architecture on MNIST. After 2 epochs, the GANs should be able to generate images that look like handwritten digits. Make sure the loss of the generator is lower than the loss of the discriminator or close to 0.


In [31]:
batch_size = 32
z_dim = 100
learning_rate = 0.0002
beta1 = 0.3


"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 2

mnist_dataset = helper.Dataset('mnist', glob(os.path.join(data_dir, 'mnist/*.jpg')))
with tf.Graph().as_default():
    train(epochs, batch_size, z_dim, learning_rate, beta1, mnist_dataset.get_batches,
          mnist_dataset.shape, mnist_dataset.image_mode)


Epoch 1/2... Discriminator Loss: 0.6419... Generator Loss: 2.0775
Epoch 1/2... Discriminator Loss: 0.7504... Generator Loss: 2.1890
Epoch 1/2... Discriminator Loss: 0.9854... Generator Loss: 1.5838
Epoch 1/2... Discriminator Loss: 1.1840... Generator Loss: 1.6751
Epoch 1/2... Discriminator Loss: 0.9569... Generator Loss: 1.1834
Epoch 1/2... Discriminator Loss: 0.8427... Generator Loss: 1.3281
Epoch 1/2... Discriminator Loss: 0.9364... Generator Loss: 2.0090
Epoch 1/2... Discriminator Loss: 0.9220... Generator Loss: 2.4484
Epoch 1/2... Discriminator Loss: 1.0405... Generator Loss: 2.0534
Epoch 1/2... Discriminator Loss: 1.3422... Generator Loss: 0.9409
Epoch 1/2... Discriminator Loss: 1.1033... Generator Loss: 1.2640
Epoch 1/2... Discriminator Loss: 1.1345... Generator Loss: 1.4418
Epoch 1/2... Discriminator Loss: 1.6097... Generator Loss: 0.6455
Epoch 1/2... Discriminator Loss: 1.0631... Generator Loss: 1.2934
Epoch 1/2... Discriminator Loss: 1.1202... Generator Loss: 0.7827
Epoch 1/2... Discriminator Loss: 1.0653... Generator Loss: 1.1785
Epoch 1/2... Discriminator Loss: 1.2442... Generator Loss: 1.7417
Epoch 1/2... Discriminator Loss: 1.1373... Generator Loss: 1.0078
Epoch 1/2... Discriminator Loss: 0.8937... Generator Loss: 1.8674
Epoch 1/2... Discriminator Loss: 1.0264... Generator Loss: 1.3185
Epoch 1/2... Discriminator Loss: 0.8600... Generator Loss: 1.3727
Epoch 1/2... Discriminator Loss: 1.1796... Generator Loss: 1.8777
Epoch 1/2... Discriminator Loss: 1.1109... Generator Loss: 1.4761
Epoch 1/2... Discriminator Loss: 1.0008... Generator Loss: 1.9202
Epoch 1/2... Discriminator Loss: 0.8585... Generator Loss: 2.2150
Epoch 1/2... Discriminator Loss: 1.1359... Generator Loss: 1.1899
Epoch 1/2... Discriminator Loss: 1.2578... Generator Loss: 0.7876
Epoch 1/2... Discriminator Loss: 0.9810... Generator Loss: 1.9892
Epoch 1/2... Discriminator Loss: 1.0246... Generator Loss: 3.1149
Epoch 1/2... Discriminator Loss: 1.1343... Generator Loss: 1.8517
Epoch 1/2... Discriminator Loss: 1.3543... Generator Loss: 3.0716
Epoch 1/2... Discriminator Loss: 0.8114... Generator Loss: 2.0825
Epoch 1/2... Discriminator Loss: 0.8661... Generator Loss: 2.3400
Epoch 1/2... Discriminator Loss: 1.0787... Generator Loss: 1.2756
Epoch 1/2... Discriminator Loss: 1.0691... Generator Loss: 1.1304
Epoch 1/2... Discriminator Loss: 1.6170... Generator Loss: 3.6481
Epoch 1/2... Discriminator Loss: 1.0526... Generator Loss: 1.4182
Epoch 1/2... Discriminator Loss: 1.1303... Generator Loss: 1.2615
Epoch 1/2... Discriminator Loss: 0.9999... Generator Loss: 2.1707
Epoch 1/2... Discriminator Loss: 1.2313... Generator Loss: 2.5221
Epoch 1/2... Discriminator Loss: 1.0098... Generator Loss: 1.4403
Epoch 1/2... Discriminator Loss: 1.2671... Generator Loss: 0.6422
Epoch 1/2... Discriminator Loss: 1.3385... Generator Loss: 1.0515
Epoch 1/2... Discriminator Loss: 1.1464... Generator Loss: 1.5931
Epoch 1/2... Discriminator Loss: 1.5873... Generator Loss: 2.8930
Epoch 1/2... Discriminator Loss: 1.1205... Generator Loss: 1.4231
Epoch 1/2... Discriminator Loss: 1.2883... Generator Loss: 2.5314
Epoch 1/2... Discriminator Loss: 0.9633... Generator Loss: 1.5351
Epoch 1/2... Discriminator Loss: 1.4616... Generator Loss: 0.6644
Epoch 1/2... Discriminator Loss: 1.1103... Generator Loss: 1.5094
Epoch 1/2... Discriminator Loss: 1.0717... Generator Loss: 1.8361
Epoch 1/2... Discriminator Loss: 0.9803... Generator Loss: 2.5166
Epoch 1/2... Discriminator Loss: 1.2361... Generator Loss: 2.1255
Epoch 1/2... Discriminator Loss: 1.0849... Generator Loss: 1.1639
Epoch 1/2... Discriminator Loss: 0.9407... Generator Loss: 2.1094
Epoch 1/2... Discriminator Loss: 1.0586... Generator Loss: 1.6573
Epoch 1/2... Discriminator Loss: 1.0459... Generator Loss: 1.2723
Epoch 1/2... Discriminator Loss: 1.0520... Generator Loss: 1.5743
Epoch 1/2... Discriminator Loss: 1.0060... Generator Loss: 1.4412
Epoch 1/2... Discriminator Loss: 1.4572... Generator Loss: 0.7113
Epoch 1/2... Discriminator Loss: 1.0501... Generator Loss: 1.3642
Epoch 1/2... Discriminator Loss: 0.9987... Generator Loss: 1.3658
Epoch 1/2... Discriminator Loss: 1.1738... Generator Loss: 0.8959
Epoch 1/2... Discriminator Loss: 0.8109... Generator Loss: 1.5595
Epoch 1/2... Discriminator Loss: 1.1050... Generator Loss: 1.7311
Epoch 1/2... Discriminator Loss: 0.9999... Generator Loss: 2.1288
Epoch 1/2... Discriminator Loss: 1.5228... Generator Loss: 2.6046
Epoch 1/2... Discriminator Loss: 0.9135... Generator Loss: 1.3467
Epoch 1/2... Discriminator Loss: 1.1154... Generator Loss: 1.2575
Epoch 1/2... Discriminator Loss: 1.0056... Generator Loss: 2.2349
Epoch 1/2... Discriminator Loss: 0.9176... Generator Loss: 1.7607
Epoch 1/2... Discriminator Loss: 0.9987... Generator Loss: 1.3972
Epoch 1/2... Discriminator Loss: 0.9672... Generator Loss: 1.4253
Epoch 1/2... Discriminator Loss: 1.1528... Generator Loss: 2.5614
Epoch 1/2... Discriminator Loss: 0.8379... Generator Loss: 1.7495
Epoch 1/2... Discriminator Loss: 1.0045... Generator Loss: 1.6719
Epoch 1/2... Discriminator Loss: 0.9404... Generator Loss: 1.3060
Epoch 1/2... Discriminator Loss: 0.9699... Generator Loss: 1.1619
Epoch 1/2... Discriminator Loss: 0.9645... Generator Loss: 1.3510
Epoch 1/2... Discriminator Loss: 0.9759... Generator Loss: 1.2770
Epoch 1/2... Discriminator Loss: 0.8847... Generator Loss: 1.9205
Epoch 1/2... Discriminator Loss: 0.8811... Generator Loss: 1.9520
Epoch 1/2... Discriminator Loss: 1.0060... Generator Loss: 1.4393
Epoch 1/2... Discriminator Loss: 1.0337... Generator Loss: 1.5263
Epoch 1/2... Discriminator Loss: 1.0724... Generator Loss: 2.4143
Epoch 1/2... Discriminator Loss: 0.9075... Generator Loss: 1.4104
Epoch 1/2... Discriminator Loss: 1.1252... Generator Loss: 1.9534
Epoch 1/2... Discriminator Loss: 1.1098... Generator Loss: 1.1480
Epoch 1/2... Discriminator Loss: 1.2333... Generator Loss: 0.9198
Epoch 1/2... Discriminator Loss: 1.0741... Generator Loss: 1.1707
Epoch 1/2... Discriminator Loss: 1.0155... Generator Loss: 1.3102
Epoch 1/2... Discriminator Loss: 1.2174... Generator Loss: 0.7972
Epoch 1/2... Discriminator Loss: 1.2129... Generator Loss: 1.4876
Epoch 1/2... Discriminator Loss: 1.3133... Generator Loss: 0.9740
Epoch 1/2... Discriminator Loss: 1.0147... Generator Loss: 1.4483
Epoch 1/2... Discriminator Loss: 1.1422... Generator Loss: 1.7012
Epoch 1/2... Discriminator Loss: 1.3766... Generator Loss: 0.7579
Epoch 1/2... Discriminator Loss: 1.0225... Generator Loss: 1.1306
Epoch 1/2... Discriminator Loss: 1.1090... Generator Loss: 1.3412
Epoch 1/2... Discriminator Loss: 0.8831... Generator Loss: 1.1050
Epoch 1/2... Discriminator Loss: 1.0534... Generator Loss: 1.8415
Epoch 1/2... Discriminator Loss: 1.0578... Generator Loss: 1.1674
Epoch 1/2... Discriminator Loss: 1.0196... Generator Loss: 1.6112
Epoch 1/2... Discriminator Loss: 0.9538... Generator Loss: 1.4980
Epoch 1/2... Discriminator Loss: 1.0221... Generator Loss: 1.2619
Epoch 1/2... Discriminator Loss: 1.0613... Generator Loss: 1.3325
Epoch 1/2... Discriminator Loss: 0.9615... Generator Loss: 1.0830
Epoch 1/2... Discriminator Loss: 1.1210... Generator Loss: 1.7114
Epoch 1/2... Discriminator Loss: 1.0690... Generator Loss: 1.4110
Epoch 1/2... Discriminator Loss: 1.0508... Generator Loss: 2.1854
Epoch 1/2... Discriminator Loss: 1.0756... Generator Loss: 1.1742
Epoch 1/2... Discriminator Loss: 1.1059... Generator Loss: 1.6914
Epoch 1/2... Discriminator Loss: 0.9243... Generator Loss: 1.4994
Epoch 1/2... Discriminator Loss: 1.0175... Generator Loss: 1.0377
Epoch 1/2... Discriminator Loss: 0.9604... Generator Loss: 0.8892
Epoch 1/2... Discriminator Loss: 0.9659... Generator Loss: 1.4894
Epoch 1/2... Discriminator Loss: 1.2387... Generator Loss: 1.5302
Epoch 1/2... Discriminator Loss: 1.1268... Generator Loss: 1.3851
Epoch 1/2... Discriminator Loss: 1.0039... Generator Loss: 2.0356
Epoch 1/2... Discriminator Loss: 1.1057... Generator Loss: 0.9387
Epoch 1/2... Discriminator Loss: 1.1864... Generator Loss: 1.0272
Epoch 1/2... Discriminator Loss: 1.2090... Generator Loss: 0.8954
Epoch 1/2... Discriminator Loss: 1.1003... Generator Loss: 1.7460
Epoch 1/2... Discriminator Loss: 0.9973... Generator Loss: 1.4665
Epoch 1/2... Discriminator Loss: 1.1771... Generator Loss: 1.0099
Epoch 1/2... Discriminator Loss: 1.1527... Generator Loss: 1.3723
Epoch 1/2... Discriminator Loss: 1.2253... Generator Loss: 1.6451
Epoch 1/2... Discriminator Loss: 0.8759... Generator Loss: 1.2830
Epoch 1/2... Discriminator Loss: 1.1658... Generator Loss: 1.5830
Epoch 1/2... Discriminator Loss: 1.1533... Generator Loss: 1.4169
Epoch 1/2... Discriminator Loss: 1.0822... Generator Loss: 1.3317
Epoch 1/2... Discriminator Loss: 0.8247... Generator Loss: 1.1219
Epoch 1/2... Discriminator Loss: 1.1254... Generator Loss: 0.8996
Epoch 1/2... Discriminator Loss: 1.1167... Generator Loss: 1.5502
Epoch 1/2... Discriminator Loss: 1.0059... Generator Loss: 1.6763
Epoch 1/2... Discriminator Loss: 1.1306... Generator Loss: 1.1459
Epoch 1/2... Discriminator Loss: 1.0659... Generator Loss: 1.3511
Epoch 1/2... Discriminator Loss: 1.1087... Generator Loss: 1.2051
Epoch 1/2... Discriminator Loss: 1.0694... Generator Loss: 1.2073
Epoch 1/2... Discriminator Loss: 0.9000... Generator Loss: 1.1652
Epoch 1/2... Discriminator Loss: 1.0885... Generator Loss: 0.9476
Epoch 1/2... Discriminator Loss: 1.1741... Generator Loss: 1.9798
Epoch 1/2... Discriminator Loss: 1.0845... Generator Loss: 1.0709
Epoch 1/2... Discriminator Loss: 1.2642... Generator Loss: 0.6335
Epoch 1/2... Discriminator Loss: 1.2996... Generator Loss: 0.8484
Epoch 1/2... Discriminator Loss: 1.2527... Generator Loss: 0.9687
Epoch 1/2... Discriminator Loss: 1.1241... Generator Loss: 1.5268
Epoch 1/2... Discriminator Loss: 1.1770... Generator Loss: 1.3961
Epoch 1/2... Discriminator Loss: 1.0245... Generator Loss: 1.4624
Epoch 1/2... Discriminator Loss: 1.0474... Generator Loss: 1.0506
Epoch 1/2... Discriminator Loss: 0.9961... Generator Loss: 1.1584
Epoch 1/2... Discriminator Loss: 0.9792... Generator Loss: 1.0358
Epoch 1/2... Discriminator Loss: 1.1319... Generator Loss: 1.5309
Epoch 1/2... Discriminator Loss: 1.1682... Generator Loss: 1.3025
Epoch 1/2... Discriminator Loss: 1.0479... Generator Loss: 1.0096
Epoch 1/2... Discriminator Loss: 1.0966... Generator Loss: 1.1732
Epoch 1/2... Discriminator Loss: 1.1837... Generator Loss: 1.3731
Epoch 1/2... Discriminator Loss: 1.0523... Generator Loss: 1.7089
Epoch 1/2... Discriminator Loss: 1.2154... Generator Loss: 1.0462
Epoch 1/2... Discriminator Loss: 1.1394... Generator Loss: 1.3799
Epoch 1/2... Discriminator Loss: 1.1248... Generator Loss: 1.3440
Epoch 1/2... Discriminator Loss: 0.9801... Generator Loss: 1.4879
Epoch 1/2... Discriminator Loss: 1.0308... Generator Loss: 1.1896
Epoch 1/2... Discriminator Loss: 0.9448... Generator Loss: 1.8012
Epoch 1/2... Discriminator Loss: 1.0566... Generator Loss: 1.0590
Epoch 1/2... Discriminator Loss: 1.1019... Generator Loss: 0.9028
Epoch 1/2... Discriminator Loss: 1.1954... Generator Loss: 1.1390
Epoch 1/2... Discriminator Loss: 1.1115... Generator Loss: 1.3145
Epoch 1/2... Discriminator Loss: 0.8718... Generator Loss: 1.2927
Epoch 1/2... Discriminator Loss: 1.1983... Generator Loss: 0.8551
Epoch 1/2... Discriminator Loss: 0.9480... Generator Loss: 1.6949
Epoch 1/2... Discriminator Loss: 1.1431... Generator Loss: 1.3830
Epoch 1/2... Discriminator Loss: 1.0148... Generator Loss: 1.7029
Epoch 1/2... Discriminator Loss: 1.0489... Generator Loss: 1.4889
Epoch 1/2... Discriminator Loss: 0.9949... Generator Loss: 1.3065
Epoch 1/2... Discriminator Loss: 1.1721... Generator Loss: 1.0438
Epoch 1/2... Discriminator Loss: 1.0266... Generator Loss: 1.3819
Epoch 1/2... Discriminator Loss: 1.0546... Generator Loss: 1.5864
Epoch 1/2... Discriminator Loss: 1.0596... Generator Loss: 0.9137
Epoch 1/2... Discriminator Loss: 1.2347... Generator Loss: 0.8963
Epoch 1/2... Discriminator Loss: 1.1189... Generator Loss: 1.5557
Epoch 1/2... Discriminator Loss: 1.3362... Generator Loss: 1.3992
Epoch 1/2... Discriminator Loss: 1.1333... Generator Loss: 2.0864
Epoch 1/2... Discriminator Loss: 0.9967... Generator Loss: 1.2589
Epoch 1/2... Discriminator Loss: 0.9662... Generator Loss: 1.5727
Epoch 1/2... Discriminator Loss: 1.1388... Generator Loss: 0.7997
Epoch 1/2... Discriminator Loss: 1.0877... Generator Loss: 1.2862
Epoch 2/2... Discriminator Loss: 1.1190... Generator Loss: 0.8837
Epoch 2/2... Discriminator Loss: 1.0763... Generator Loss: 1.6006
Epoch 2/2... Discriminator Loss: 0.9940... Generator Loss: 1.0360
Epoch 2/2... Discriminator Loss: 1.0727... Generator Loss: 1.0547
Epoch 2/2... Discriminator Loss: 1.0171... Generator Loss: 1.4660
Epoch 2/2... Discriminator Loss: 1.2540... Generator Loss: 0.9206
Epoch 2/2... Discriminator Loss: 1.0162... Generator Loss: 1.3709
Epoch 2/2... Discriminator Loss: 1.2208... Generator Loss: 0.7051
Epoch 2/2... Discriminator Loss: 1.0800... Generator Loss: 1.1369
Epoch 2/2... Discriminator Loss: 0.9307... Generator Loss: 1.4008
Epoch 2/2... Discriminator Loss: 1.0568... Generator Loss: 1.6118
Epoch 2/2... Discriminator Loss: 0.9634... Generator Loss: 1.2384
Epoch 2/2... Discriminator Loss: 1.0574... Generator Loss: 1.5761
Epoch 2/2... Discriminator Loss: 1.0941... Generator Loss: 1.0398
Epoch 2/2... Discriminator Loss: 0.9892... Generator Loss: 1.3926
Epoch 2/2... Discriminator Loss: 1.0149... Generator Loss: 1.3707
Epoch 2/2... Discriminator Loss: 0.9581... Generator Loss: 1.4976
Epoch 2/2... Discriminator Loss: 0.9688... Generator Loss: 1.3640
Epoch 2/2... Discriminator Loss: 0.9793... Generator Loss: 1.2864
Epoch 2/2... Discriminator Loss: 0.9966... Generator Loss: 1.0446
Epoch 2/2... Discriminator Loss: 1.0456... Generator Loss: 1.4274
Epoch 2/2... Discriminator Loss: 1.0378... Generator Loss: 1.5859
Epoch 2/2... Discriminator Loss: 0.9621... Generator Loss: 1.3082
Epoch 2/2... Discriminator Loss: 1.0876... Generator Loss: 1.1410
Epoch 2/2... Discriminator Loss: 1.2140... Generator Loss: 0.9056
Epoch 2/2... Discriminator Loss: 1.2836... Generator Loss: 1.3761
Epoch 2/2... Discriminator Loss: 0.9567... Generator Loss: 1.7870
Epoch 2/2... Discriminator Loss: 1.3032... Generator Loss: 1.2079
Epoch 2/2... Discriminator Loss: 1.2296... Generator Loss: 1.9580
Epoch 2/2... Discriminator Loss: 1.1842... Generator Loss: 1.9007
Epoch 2/2... Discriminator Loss: 1.1254... Generator Loss: 1.0586
Epoch 2/2... Discriminator Loss: 1.1323... Generator Loss: 1.1672
Epoch 2/2... Discriminator Loss: 1.1320... Generator Loss: 0.7699
Epoch 2/2... Discriminator Loss: 0.9678... Generator Loss: 1.2872
Epoch 2/2... Discriminator Loss: 0.9060... Generator Loss: 1.8033
Epoch 2/2... Discriminator Loss: 0.8919... Generator Loss: 1.6814
Epoch 2/2... Discriminator Loss: 1.4160... Generator Loss: 2.1912
Epoch 2/2... Discriminator Loss: 1.1384... Generator Loss: 1.5980
Epoch 2/2... Discriminator Loss: 1.1323... Generator Loss: 1.6190
Epoch 2/2... Discriminator Loss: 1.2159... Generator Loss: 1.4119
Epoch 2/2... Discriminator Loss: 1.0849... Generator Loss: 0.9763
Epoch 2/2... Discriminator Loss: 1.0175... Generator Loss: 1.3635
Epoch 2/2... Discriminator Loss: 1.2753... Generator Loss: 2.1802
Epoch 2/2... Discriminator Loss: 0.8682... Generator Loss: 1.6172
Epoch 2/2... Discriminator Loss: 0.8537... Generator Loss: 1.4487
Epoch 2/2... Discriminator Loss: 0.9036... Generator Loss: 1.1720
Epoch 2/2... Discriminator Loss: 1.0296... Generator Loss: 1.1614
Epoch 2/2... Discriminator Loss: 1.1588... Generator Loss: 1.2586
Epoch 2/2... Discriminator Loss: 1.0843... Generator Loss: 1.0070
Epoch 2/2... Discriminator Loss: 1.1684... Generator Loss: 1.0670
Epoch 2/2... Discriminator Loss: 1.0750... Generator Loss: 1.1349
Epoch 2/2... Discriminator Loss: 0.7352... Generator Loss: 1.6002
Epoch 2/2... Discriminator Loss: 1.2550... Generator Loss: 1.7085
Epoch 2/2... Discriminator Loss: 1.4500... Generator Loss: 0.6727
Epoch 2/2... Discriminator Loss: 0.7706... Generator Loss: 0.8848
Epoch 2/2... Discriminator Loss: 1.2290... Generator Loss: 1.9513
Epoch 2/2... Discriminator Loss: 0.9549... Generator Loss: 1.0407
Epoch 2/2... Discriminator Loss: 1.0628... Generator Loss: 1.1295
Epoch 2/2... Discriminator Loss: 0.9324... Generator Loss: 1.5404
Epoch 2/2... Discriminator Loss: 0.8938... Generator Loss: 1.7729
Epoch 2/2... Discriminator Loss: 1.0164... Generator Loss: 1.1221
Epoch 2/2... Discriminator Loss: 1.1346... Generator Loss: 1.9618
Epoch 2/2... Discriminator Loss: 1.0782... Generator Loss: 1.4352
Epoch 2/2... Discriminator Loss: 0.9860... Generator Loss: 1.2004
Epoch 2/2... Discriminator Loss: 0.9773... Generator Loss: 1.8971
Epoch 2/2... Discriminator Loss: 1.0315... Generator Loss: 0.9297
Epoch 2/2... Discriminator Loss: 0.7700... Generator Loss: 1.5896
Epoch 2/2... Discriminator Loss: 1.1035... Generator Loss: 1.2830
Epoch 2/2... Discriminator Loss: 0.9874... Generator Loss: 1.8146
Epoch 2/2... Discriminator Loss: 1.1242... Generator Loss: 1.0925
Epoch 2/2... Discriminator Loss: 1.0511... Generator Loss: 2.2078
Epoch 2/2... Discriminator Loss: 1.0196... Generator Loss: 1.3535
Epoch 2/2... Discriminator Loss: 0.8672... Generator Loss: 0.9961
Epoch 2/2... Discriminator Loss: 1.0611... Generator Loss: 0.9110
Epoch 2/2... Discriminator Loss: 0.8102... Generator Loss: 1.7275
Epoch 2/2... Discriminator Loss: 0.9402... Generator Loss: 0.9230
Epoch 2/2... Discriminator Loss: 1.1224... Generator Loss: 1.8802
Epoch 2/2... Discriminator Loss: 0.8766... Generator Loss: 1.5978
Epoch 2/2... Discriminator Loss: 0.8419... Generator Loss: 1.1091
Epoch 2/2... Discriminator Loss: 0.8197... Generator Loss: 1.2318
Epoch 2/2... Discriminator Loss: 1.2227... Generator Loss: 1.4821
Epoch 2/2... Discriminator Loss: 0.8731... Generator Loss: 1.0338
Epoch 2/2... Discriminator Loss: 1.1155... Generator Loss: 1.0402