16.03.2021 Views

Advanced Deep Learning with Keras

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

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

Cross-Domain GANs

We should note that PatchGAN is not introducing a new type of GAN in

CycleGAN. To improve the generated image quality, instead of having one output

to discriminate, we have four outputs to discriminate if we used a 2 × 2 PatchGAN.

There are no changes in the loss functions. Intuitively, this makes sense since the

whole image will look more real if every patch or section of the image looks real:

Figure 7.1.7: A comparison between GAN and PatchGAN discriminators

Following figure shows the discriminator network as implemented in Keras. The

illustration shows the discriminator determining how likely the input image or

a patch is a color CIFAR10 image. Since the output image is small at only 32 × 32

RGB, a single scalar representing that the image is real is sufficient. However, we

also evaluate the results when PatchGAN is used. Listing 7.1.3 shows the function

builder for the discriminator:

Figure 7.1.8: The target discriminator, D y

, implementation in Keras. The PatchGAN discriminator is shown on the right.

[ 216 ]

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

Saved successfully!

Ooh no, something went wrong!