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.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py
index 921e586..ccb10cd 100644
--- a/cli/app/search/search_class.py
+++ b/cli/app/search/search_class.py
@@ -113,7 +113,7 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la
## normalize the Y encoding
# 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)
+ normalized_labels = input_y / tf.reduce_max(input_y)
normalized_alpha = tf.compat.v1.placeholder(dtype=np.float32, shape=())
clip_labels = tf.assign(input_y, normalized_labels * (1 - normalized_alpha) + input_y * normalized_alpha)
@@ -196,7 +196,8 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la
if opt_stochastic_clipping and (i % opt_clip_interval) == 0: # and i < opt_steps * 0.45:
sess.run(clip_latent, { clipped_alpha: (i / opt_steps) * 2 })
if opt_label_clipping and (i % opt_clip_interval) == 0: # and i < opt_steps * 0.75:
- sess.run(clip_labels, { normalized_alpha: (i / opt_steps) ** 2 })
+ # sess.run(clip_labels, { normalized_alpha: (i / opt_steps) ** 2 })
+ sess.run(clip_labels, { normalized_alpha: i / opt_steps })
if opt_video and opt_snapshot_interval != 0 and (i % opt_snapshot_interval) == 0:
phi_guess = sess.run(output)
guess_im = imgrid(imconvert_uint8(phi_guess), cols=1)