Example #1
0
def main(_):
    hparams = eval_lib.HParams(
        FLAGS.master, FLAGS.checkpoint_dir, FLAGS.eval_dir,
        FLAGS.num_images_generated, FLAGS.num_inception_images,
        FLAGS.eval_real_images, FLAGS.eval_frechet_inception_distance,
        FLAGS.max_number_of_evaluations, FLAGS.write_to_disk)
    eval_lib.evaluate(hparams, run_eval_loop=True)
Example #2
0
    def test_build_graph(self, mock_provide_data, mock_iscore, mock_fid,
                         eval_real_images):
        hparams = eval_lib.HParams(master='',
                                   checkpoint_dir='/tmp/cifar10/',
                                   eval_dir='/tmp/cifar10/',
                                   num_images_generated=100,
                                   num_inception_images=10,
                                   eval_real_images=eval_real_images,
                                   eval_frechet_inception_distance=True,
                                   max_number_of_evaluations=None,
                                   write_to_disk=True)

        # Mock reads from disk.
        mock_provide_data.return_value = (tf.ones(
            [hparams.num_images_generated, 32, 32,
             3]), tf.zeros([hparams.num_images_generated]))

        # Mock `frechet_inception_distance` and `inception_score`, which are
        # expensive.
        mock_fid.return_value = 1.0
        mock_iscore.return_value = 1.0

        eval_lib.evaluate(hparams, run_eval_loop=False)