diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-21 14:42:02 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-21 14:42:02 +0100 |
| commit | b503a0b47c5f85e380fa4ab24deed2420456ae5f (patch) | |
| tree | dbb02bce3f81ec1a2e4dd396afdca36d8efc5a71 /cli/app/search/search_class.py | |
| parent | 7b742326d25a21c9c6f97766e0501ec0f5362099 (diff) | |
emphasize matching class rather than minimizing l1
Diffstat (limited to 'cli/app/search/search_class.py')
| -rw-r--r-- | cli/app/search/search_class.py | 5 |
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) |
