Now that our first image generator is trained, aren't you curious about what it is capable of and how images are generated from random noise vectors? In this section, we will have some fun with the generator network. First, we will choose two random vectors and calculate the interpolation between them to see what images will be generated. Second, we will choose some exemplary vectors and perform arithmetic calculations on them to find out what changes appear in the generated samples.
First, we need a test version of the DCGAN code.
Copy your original dcgan.py file to dcgan_test.py. Next, we need to make some changes to our new file. First, we need to replace these lines of just the Generator class:
netG = Generator().to(device)
netG.apply(weights_init)
print(netG)
We replace them with the following lines (you can either delete them or...