diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-08 01:31:23 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-08 01:31:23 +0100 |
| commit | 1365305eaaeb63c6b9b1bce30b33fcb364708389 (patch) | |
| tree | b2176a3a134967aa2005b262141e6492ee667bd1 /cli/app/search/search_class.py | |
| parent | 3ee509c0d76f35d0d2fc062712306538aeabd451 (diff) | |
getting latent search updates working...
Diffstat (limited to 'cli/app/search/search_class.py')
| -rw-r--r-- | cli/app/search/search_class.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py index 420c0de..c59bc9b 100644 --- a/cli/app/search/search_class.py +++ b/cli/app/search/search_class.py @@ -103,7 +103,7 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la 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) + 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)) @@ -138,7 +138,7 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la layer_name = feature_layer_names[layer] gen_feat = gen_feat_ex[layer_name] target_feat = target_feat_ex[layer_name] - feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) + feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [batch_size, -1]) feat_loss += tf.reduce_mean(feat_square_diff) / len(opt_feature_layers) # Batch reconstruction error. |
