最近发布的TFGAN module README包含有关如何合并l1_pixel_loss
:
# Modify the loss tuple to include the pixel loss.
gan_loss = tfgan.losses.combine_adversarial_loss(
gan_loss, gan_model, l1_pixel_loss, weight_factor=FLAGS.weight_factor)
该模块还包含一个GANEstimator类,但没有很多示例,具体说明没有关于如何组合l1_pixel_loss
的示例。
# Create GAN estimator.
gan_estimator = estimator.GANEstimator(
model_dir,
generator_fn=generator_fn,
discriminator_fn=discriminator_fn,
generator_loss_fn=tfgan.losses.wasserstein_generator_loss,
discriminator_loss_fn=tfgan.losses.wasserstein_discriminator_loss,
generator_optimizer=tf.train.AdamOptimizier(0.1, 0.5),
discriminator_optimizer=tf.train.AdamOptimizier(0.1, 0.5))
如何正确地将l1_pixel_loss
添加到GANEstimator?