diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-23 14:30:58 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-23 14:30:58 +0100 |
| commit | 983127c4efc8b6d13df2df715cb3d1890bd6a088 (patch) | |
| tree | a7d76ccc8d37bc1002f5c3f15a3f1188e559b2d6 | |
| parent | b25a3e0141c943fd3645a494bf833fcc7ed5d400 (diff) | |
clipping again?
| -rw-r--r-- | cli/app/commands/biggan/extract_dense_vectors.py | 2 | ||||
| -rw-r--r-- | cli/app/search/search_class.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cli/app/commands/biggan/extract_dense_vectors.py b/cli/app/commands/biggan/extract_dense_vectors.py index 622a094..e8f0587 100644 --- a/cli/app/commands/biggan/extract_dense_vectors.py +++ b/cli/app/commands/biggan/extract_dense_vectors.py @@ -24,7 +24,7 @@ from app.search.params import timestamp help='Normalize labels every N steps') @click.option('-feat', '--use_feature_detector', 'opt_use_feature_detector', is_flag=True, help='Compute feature loss') -@click.option('-ll', '--feature_layers', 'opt_feature_layers', default="1a,3a,4a,7a", +@click.option('-ll', '--feature_layers', 'opt_feature_layers', default="1a,2a,3a,4a,7a", help='Feature layers used for loss') @click.option('-snap', '--snapshot_interval', 'opt_snapshot_interval', default=20, help='Interval to store sample images') diff --git a/cli/app/search/search_class.py b/cli/app/search/search_class.py index fb497f3..a98d7e3 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.45: - sess.run(clip_latent, { clipped_alpha: 0.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) }) 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: 0.0 }) + sess.run(clip_labels, { normalized_alpha: (i / opt_steps) }) sess.run(reinit_optimizer_y) if opt_video and opt_snapshot_interval != 0 and (i % opt_snapshot_interval) == 0: phi_guess = sess.run(output) |
