diff options
| -rw-r--r-- | cli/app/commands/biggan/search.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/app/commands/biggan/search.py b/cli/app/commands/biggan/search.py index a2e73eb..d2b5900 100644 --- a/cli/app/commands/biggan/search.py +++ b/cli/app/commands/biggan/search.py @@ -151,8 +151,9 @@ def find_nearest_vector(generator, sess, input_z, input_y, input_trunc, output, # for j in range(batch_size): # y[j] /= y[j].sum() if i > 200 and i % 100 == 0: + n = i / opt_steps mean = np.mean(y, axis=0) - y = y * 3 / 4 + mean / 4 + y = y * (1 - n) + mean * n indices = np.logical_or(z <= -2*truncation, z >= +2*truncation) z[indices] = np.random.randn(np.count_nonzero(indices)) @@ -166,7 +167,7 @@ def find_nearest_vector(generator, sess, input_z, input_y, input_trunc, output, except KeyboardInterrupt: pass print(y.shape) - out_labels[index] = y + out_labels[index] = np.mean(y, axis=0) return fp_frames def export_video(fp_frames): |
