Optimizers
Finally, the optimizers part! In this section, we will define the optimization criteria that will be used during the training process. First off, we are going to update the variables of the generator and discriminator separately, so we need to be able to retrieve the variables of each part.
For the first optimizer, the generator one, we will retrieve all the variables that start with the name generator from the trainable variables of the computational graph; then we can check which variable is which by referring to its name.
We'll do the same for the discriminator variables as well, by letting in all variables that start with discriminator. After that, we can pass the list of variables that we want to be optimized to the optimizer. ...
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