Creating a generator

Let's take a look at the components of the generator network:

Generator architecture of SRGAN (2X)

In the preceding diagram, we upscale a 512*512 image by 2x (to 1,024*1,024) as an example. The size of the input image is rather arbitrary since the design of each component in the generator network is independent of the size of feature maps. The upsampling block is responsible for expanding the image size by two. If we want to upscale by four, we simply need to append another upsampling block to the end of the existing one. Using three upsampling blocks will, of course, expand the image size by eight.

In the generator network, ...

Get Hands-On Generative Adversarial Networks with PyTorch 1.x now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.