From 1365305eaaeb63c6b9b1bce30b33fcb364708389 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 8 Jan 2020 01:31:23 +0100 Subject: getting latent search updates working... --- cli/app/search/search_class.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/app/search/search_class.py') 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. -- cgit v1.2.3-70-g09d2