diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-08 01:29:41 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-08 01:29:41 +0100 |
| commit | 3ee509c0d76f35d0d2fc062712306538aeabd451 (patch) | |
| tree | bb6a93aab73625c886d6a13a798cbb5f57331f4c | |
| parent | f86e1d17776f022861ed1799d6f58a7a362bafde (diff) | |
getting latent search updates working...
| -rw-r--r-- | cli/app/search/search_class.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py index 6bf6a59..420c0de 100644 --- a/cli/app/search/search_class.py +++ b/cli/app/search/search_class.py @@ -100,8 +100,10 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la ## clip the Z encoding - clipped_encoding = tf.where(tf.abs(input_z) >= params.clip, - tf.random.uniform([BATCH_SIZE, Z_DIM], minval=-params.clip, maxval=params.clip), input_z) + opt_clip = 1.0 + + clipped_encoding = tf.where(tf.abs(input_z) >= opt_clip, + 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)) @@ -112,6 +114,7 @@ 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_img - gen_img) / 2.0) mse_loss = tf.reduce_mean(pix_square_diff) |
