
Explore high resolution generative adversarial networks, including ProGAN and StyleGAN 1 and 2, and learn to train a GAN producing photorealistic images with TensorFlow 2.0 on Colab.
Demystify generative adversarial networks by showing the generator and discriminator cooperate, guided by a differentiable loss function, with the discriminator acting as a teacher rather than an adversary.
Explore the generator architecture in high resolution GANs, including latent vector normalization. Understand how upsampling and deltas transform a four-by-four block into a 512 by 512, 3-channel image in stylegan2.
Explore how a generator uses a lead vector, pixel form normalization, and a dense layer to create a 4x4x512 volume, then upscales with deltas to 512x512 rgb.
Discriminator uses a batch of images with a mini batch standard deviation to assess variety, then processes through residual convolutional blocks and a final dense layer to output realism scores.
Explore the discriminator architecture details, including input normalization from 0-1 to -1-1, one-by-one and 1x1 convolutions, downsampling with residual connections, and minibatch standard deviation for real vs fake detection.
Explore scaled weight initialization and per-layer scaling to stabilize activations in convolutional networks for high-resolution GANs, using TensorFlow to print mean, standard deviation, and sample outputs.
Explains building a conv2d-like layer: validate 4d input, initialize kernel and bias, compute a scalar scale from kernel shape, optionally apply pre blur, convolve with padding and add bias.
Explain the dense layer initialization and forward pass by detailing kernel shapes, bias, and scale, using random normal initialization and matrix multiplication with the previous layer output count as input.
Explore leaky relu scaling in high resolution GANs by setting the alpha factor, gain as the scale parameter, and applying the sqrt(2) constant in the call.
Explore resampling theory by downsampling with blur to preserve information from neighboring pixels, and upsample by zero-padding with blur; note brightness reduces and multiplying by four corrects it.
Explore how a stepwise convolutional filter blurs an image by averaging a four-by-four region with center, adjacent, and corner weights, normalized to preserve intensity.
Build a blur filter matching the input data type and apply a depthwise convolution to a [batch, height, width, channels] tensor. Tile the filter across channels and set spatial strides.
Explore resampling code for high-resolution GANs by implementing downsampling via blur and drop, and upsampling with zero filling, padding, and reshaping (with fourfold pre-multiplication) to improve efficiency.
Explain upsampling and downsampling in high resolution GANs using transpose convolutions, blur to avoid checkerboard artifacts, and the role of stride and gradients.
Explore the code for combining convolution and resampling, and for downsampling followed by convolution, including pre blur and stride handling to downsample effectively.
Implement a dedicated upsampling layer for GANs using a 3x3 kernel, stride 2, and same padding, with channel count as the only input parameter and kernel bias and scale initialization.
Explore how batch standard deviation combats mode collapse in high-resolution GANs by grouping the batch, computing groupwise deviations, and feeding the mean back to the discriminator.
Explore group-wise standard deviation in code by reshaping inputs into groups, validating group and batch sizes, applying a safe, epsilon-regularized calculation, and broadcasting the result as a new feature.
Explore pixelwise normalization theory for GAN generators, replacing batch normalization to prevent signal escalation, enable latent vector-driven image variation, and reduce artifacts.
Apply pixelwise normalization to a tensor by casting to float32, normalizing along the last axis with an epsilon safeguard, and casting back, via a dedicated pixel form layer.
Describe the image conversion layer that maps between -1..1 and 0..1, toggled by a conversion mode, using double-and-subtract-one for 0..1 to -1..1 and add half for the reverse.
Create a generator using a functional api that accepts a latent vector and resolution, validates the input, and builds residual blocks to output rgb values in -1 to 1.
Learn to build a high-resolution discriminator using a recursive, residual body in the functional API, transforming four-by-four inputs through downsampling and feature-count blocks to a final classification.
Overview of high-level gan training: alternate one generator step and one discriminator step, use random latent vectors to produce fake images, and compute losses to boost realism.
Explore why the Wasserstein loss struggles at high resolutions and hinders fine detail. Compare it to the R2 loss, which delivers sharper hair and eye textures.
Explore the R2 loss theory for high-resolution GANs, focusing on gradient-based regularisation of the discriminator and generator, real and fake scores, softplus handling, and stability toward convergence in training.
Implement lazy regularisation in high resolution GANs by splitting regularisation into its own step and using a new batch of real images to compute gradients, enabling memory savings.
Explore the step function code for training a high-resolution GAN, detailing the generator and discriminator setup, learning rate, and the 16 to 17 optimizer update pattern.
Demonstrate a simple example of distributed computation with tf.distribute on Colab TPU to estimate pi via Monte Carlo, including runtime setup, strategy scope, and reduction.
Pad dimensions to multiples of eight and the channel dimension to 128 to fit hardware, watch batch size for memory, and minimize retracing from the first TensorFlow function compilation.
Implement a distributed strategy for GAN training by mirroring across GPUs, distributing the dataset, and synchronizing gradients across replicas within strategy scope, with global batch size and epic batch count.
This course covers the fundamentals necessary for a state-of-the-art GAN. Anyone who experimented with GANs on their own knows that it's easy to throw together a GAN that spits out MNIST digits, but it's another level of difficulty entirely to produce photorealistic images at a resolution higher than a thumbnail.
This course comprehensively bridges the gap between MNIST digits and high-definition faces. You'll create and train a GAN that can be used in real-world applications.
And because training high-resolution networks of any kind is computationally expensively, you'll also learn how to distribute your training across multiple GPUs or TPUs. Then for training, we'll leverage Google's TPU hardware for free in Google Colab. This allows students to train generators up to 512x512 resolution with no hardware costs at all.
The material for this course was pulled from the ProGAN, StyleGAN, and StyleGAN 2 papers which have produced ground-breaking and awe-inspiring results. We'll even use the same Flicker Faces HD dataset to replicate their results.
Finally, what GAN course would be complete without having some fun with the generator? Students will learn not only how to generate an infinite quantity of unique images, but also how to filter them to the highest-quality images by using a perceptual path length filter. You'll even learn how to generate smooth interpolations between two generated images, which make for some really interesting visuals.