Defining the generator model

The generator model is the neural network that creates synthetic target data out of random inputs. In this case, we will use a convolutional neural network (CNN) in reverse. What this means is that we will start with a vector of data points and create a fully connected layer, then reshape the data into the size that we want it to be. As a middle step, we will make the target shape only half the size and then we will upsample using a transposed convolution layer. In the end, we have an array of normalized pixel values that is the same shape as our target array. This then becomes the data object that will be used to try to fool the discriminator model. This array of synthetic values will, over time, be trained to ...

Get Hands-On Deep Learning with R 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.