diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-25 18:30:39 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-25 18:30:39 +0100 |
| commit | 176af09d1aa3caeecd454a8fe9754e5cb5dc75ff (patch) | |
| tree | cb184d2f8bb1015d1d23936c472e4e8343497e7b /cli/app/search | |
| parent | f6fda6b7ab25c8a3745997d7ea5eb3663e51955c (diff) | |
adjust
Diffstat (limited to 'cli/app/search')
| -rw-r--r-- | cli/app/search/json.py | 4 | ||||
| -rw-r--r-- | cli/app/search/search_class.py | 8 | ||||
| -rw-r--r-- | cli/app/search/search_dense.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/cli/app/search/json.py b/cli/app/search/json.py index c4c0903..7873c23 100644 --- a/cli/app/search/json.py +++ b/cli/app/search/json.py @@ -68,7 +68,7 @@ def make_params_dense(tag, folder_id): "dataset": os.path.join(app_cfg.DIR_INVERSES, tag, "dataset.latent.hdf5"), "inv_layer": "Generator_2/G_Z/Reshape:0", "decay_lr": True, - "inv_it": 20000, + "inv_it": 10000, "generator_path": "https://tfhub.dev/deepmind/biggan-512/2", "attention_map_layer": "Generator_2/attention/Softmax:0", "pre_trained_latent": True, @@ -91,7 +91,7 @@ def make_params_dense(tag, folder_id): "feature_extractor_output": "InceptionV3/Mixed_7a", "init_lo": -0.001, "lambda_dist": 10.0, - "lambda_feat": 2.0, + "lambda_feat": 1.0, "lambda_mse": 1.0, "lambda_reg": 0.1, "dist_loss": False, diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py index a98d7e3..371316e 100644 --- a/cli/app/search/search_class.py +++ b/cli/app/search/search_class.py @@ -200,12 +200,12 @@ 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 and (i % opt_clip_interval) == 0 and i < opt_steps * 0.75: - sess.run(clip_latent, { clipped_alpha: (i / opt_steps) }) + if opt_stochastic_clipping and (i % opt_clip_interval) == 0: # and i < opt_steps * 0.75: + sess.run(clip_latent, { clipped_alpha: 0.0 }) sess.run(reinit_optimizer_z) - if opt_label_clipping and (i % opt_clip_interval) == 0 and i < opt_steps * 0.75: + 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) }) + sess.run(clip_labels, { normalized_alpha: 0.0 }) sess.run(reinit_optimizer_y) if opt_video and opt_snapshot_interval != 0 and (i % opt_snapshot_interval) == 0: phi_guess = sess.run(output) diff --git a/cli/app/search/search_dense.py b/cli/app/search/search_dense.py index 149b8f6..36fc230 100644 --- a/cli/app/search/search_dense.py +++ b/cli/app/search/search_dense.py @@ -299,7 +299,7 @@ def find_dense_embedding_for_images(params, opt_tag="inverse_" + timestamp(), op # -------------------------- if params.decay_lr: lrate = tf.train.exponential_decay(params.lr, inv_step, - params.inv_it / params.decay_n, 0.1) #, staircase=True) + params.inv_it / params.decay_n, 0.1, staircase=True) else: lrate = tf.constant(params.lr) # trained_params = [label, latent, encoding] |
