summaryrefslogtreecommitdiff
path: root/cli/app/search/search_class.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app/search/search_class.py')
-rw-r--r--cli/app/search/search_class.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py
index f7b2136..105fc9f 100644
--- a/cli/app/search/search_class.py
+++ b/cli/app/search/search_class.py
@@ -96,6 +96,8 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la
'truncation': input_trunc,
})
+ target = tf.compat.v1.placeholder(tf.float32, shape=(batch_size, img_size, img_size, num_channels))
+
## clip the Z encoding
opt_clip = 1.0
@@ -104,10 +106,10 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la
tf.random.uniform([batch_size, z_dim], minval=-opt_clip, maxval=opt_clip), input_z)
clip_latent = tf.assign(input_z, clipped_encoding)
- target = tf.compat.v1.placeholder(tf.float32, shape=(batch_size, img_size, img_size, num_channels))
-
## normalize the Y encoding
- normalized_labels = tf.nn.l2_normalize(input_y)
+ # normalized_labels = tf.nn.l2_normalize(input_y)
+ # tf.reduce_mean(tf.abs(encoding - gen_encoding))
+ normalized_labels = input_y / tf.reduce_sum(input_y)
clip_labels = tf.assign(input_y, normalized_labels)
## if computing Feature loss, use these encoders