May 2019
Intermediate to advanced
272 pages
7h 19m
English
For logging, we take advantage of Tensorboard's ability to log text by using the .add_text routine. This function takes as input the name of the tab associated with this text field, the text, and the iteration number:
def log_text(texts, name, i, logger): texts = '\n'.join(texts) logger.add_text('{}_{}'.format(name, i), texts, i)
For reporting losses, we include an extra scalar for the generator's reconstruction loss. The add_scalar function takes as input the name of the tab associated with this scalar field, the scalar value, and the iteration number. Note that the Wasserstein GAN with Gradient Penalty has an extra loss term related to the Gradient Penalty:
def log_losses(loss_d, loss_g, iteration, logger): names = ['loss_d', 'loss_d_real', ...
Read now
Unlock full access