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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py
index 7961a0c..c732801 100644
--- a/cli/app/search/search_class.py
+++ b/cli/app/search/search_class.py
@@ -45,7 +45,7 @@ feature_layer_names = {
}
def find_nearest_vector_for_images(paths, opt_dims, opt_steps, opt_video, opt_tag,
- opt_limit=-1, opt_stochastic_clipping=0, opt_label_clipping=0,
+ opt_limit=-1, opt_stochastic_clipping=True, opt_label_clipping=True,
opt_use_feature_detector=False, opt_feature_layers=[1,2,4,7], opt_snapshot_interval=20, opt_clip_interval=500):
tf.reset_default_graph()
sess = tf.compat.v1.Session()
@@ -186,9 +186,9 @@ def find_nearest_vector(sess, generator, opt_fp_in, opt_dims, out_images, out_la
if i % 20 == 0:
print('iter: {}, loss: {}'.format(i, curr_loss))
if i > 0:
- if opt_stochastic_clipping != 0 and (i % opt_stochastic_clipping) == 0:
+ if opt_stochastic_clipping and (i % opt_clip_interval) == 0:
sess.run(clip_latent)
- if opt_label_clipping != 0 and (i % opt_label_clipping) == 0:
+ if opt_label_clipping and (i % opt_clip_interval) == 0:
sess.run(clip_labels)
if opt_video and opt_snapshot_interval != 0 and (i % opt_snapshot_interval) == 0:
phi_guess = sess.run(output)