(fake_images)
return score
Compute ms-ssim score .
Compute ms-ssim score .
Compute ms - ssim score .
def _compute_multiscale_ssim_score(fake_images):
  """Compute ms-ssim score ."""
  batch_size = 64
  with tf.Graph().as_default():
    fake_images_batch = tf.train.shuffle_batch(
        [tf.convert_to_tensor(fake_images, dtype=tf.float32)],
        capacity=16*batch_size,
        min_after_dequeue=8*batch_size,
        num_threads=4,
        enqueue_many=True,
        batch_size=batch_size)

    # Following section 5.3 of https://arxiv.org/pdf/1710.08446.pdf, we only
    # evaluate 5 batches of the generated images.
    eval_fn = compute_msssim(
        generated_images=fake_images_batch, num_batches=5)
    with tf.train.MonitoredTrainingSession() as sess:
      score = eval_fn(sess)
  return score
def _compute_multiscale_ssim_score ( fake_images ) : batch_size = 64 with tf . Graph ( ) . as_default ( ) : fake_images_batch = tf . train . shuffle_batch ( [ tf . convert_to_tensor ( fake_images , dtype = tf . float32 ) ] , capacity = 16 * batch_size , min_after_dequeue = 8 * batch_size , num_threads = 4 , enqueue_many = True , batch_size = batch_size ) # Following section 5.3 of https://arxiv.org/pdf/1710.08446.pdf, we only # evaluate 5 batches of the generated images. eval_fn = compute_msssim ( generated_images = fake_images_batch , num_batches = 5 ) with tf . train . MonitoredTrainingSession ( ) as sess : score = eval_fn ( sess ) return score