Custom layers
Let's take a look at the many custom layers and helper functions that are used in our Progressive Growing of GANs implementation. We are going to cover the MinibatchStatConcatLayer layer, which computes statistics that are used on the last layers of the discriminator; the WeightScalingLayer layer, which scales the weights by their L2 norm; the PixelNormLayer layer, which scales the activations; the BlockSelectionLayer layer, which chooses the model output with respect to the current level of detail; and the ResizeLayer layer, which rescales the activations.
The custom layers that we are going to write will overwrite four methods at most, including _init__, build, call, and compute_output_shape.
We will start with the MinibatchStatConcatLayer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access