09.05.2023 Views

pdfcoffee

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6

The resultant generator model is as follows:

Figure 3: A summary of the resultant generator model

You can also experiment with the transposed convolution layer.

This layer not only upsamples the input image but also learns

how to fill in details during the training. Thus, you can replace

upsampling and convolution layers with a single transposed

convolution layer. The transpose convolutional layer performs

an inverse convolution operation. You can read about it in more

detail in the paper: A guide to convolution arithmetic for deep learning

(https://arxiv.org/abs/1603.07285).

Now that we have a generator, let us see the code to build the discriminator. The

discriminator is similar to a standard convolutional neural network but with one

major change: instead of maxpooling we use convolutional layers with strides of

2. We also add dropout layers to avoid overfitting, and batch normalization for

better accuracy and fast convergence. The activation layer is leaky ReLU. In the

following network we use three such convolutional layers, with filters of 32, 64, and

128 respectively. The output of the third convolutional layer is flattened and fed

to a dense layer with a single unit.

[ 201 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!