From 8197048ae7b33ce27a810ed43ea188f3815c0f5b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 10 Feb 2020 18:48:15 +0100 Subject: feature loss on quadrants --- cli/app/commands/biggan/extract_dense_vectors.py | 2 +- cli/app/search/search_class.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/app/commands/biggan/extract_dense_vectors.py b/cli/app/commands/biggan/extract_dense_vectors.py index e8f0587..54f9762 100644 --- a/cli/app/commands/biggan/extract_dense_vectors.py +++ b/cli/app/commands/biggan/extract_dense_vectors.py @@ -10,7 +10,7 @@ from app.search.params import timestamp @click.command('') @click.option('-f', '--folder_id', 'opt_folder_id', type=int, help='Folder ID to process') -@click.option('-ls', '--latent_steps', 'opt_latent_steps', default=2000, type=int, +@click.option('-ls', '--latent_steps', 'opt_latent_steps', default=1000, type=int, help='Number of optimization iterations') @click.option('-ds', '--dense_steps', 'opt_dense_steps', default=2000, type=int, help='Number of optimization iterations') diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py index 371316e..3e36a02 100644 --- a/cli/app/search/search_class.py +++ b/cli/app/search/search_class.py @@ -120,8 +120,9 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la ## if computing Feature loss, use these encoders if opt_use_feature_detector: print("Initializing feature detector...") - pix_square_diff = tf.square((target - output) / 2.0) - mse_loss = tf.reduce_mean(pix_square_diff) + # pix_square_diff = tf.square((target - output) / 2.0) + # mse_loss = tf.reduce_mean(pix_square_diff) + mse_loss = tf.compat.v1.losses.mean_squared_error(target, output) feature_extractor = hub.Module("https://tfhub.dev/google/imagenet/inception_v3/feature_vector/1") -- cgit v1.2.3-70-g09d2