From 12e015807c1db187895aeca495b77b367c543211 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 11 Dec 2019 00:15:20 +0100 Subject: steps --- cli/app/commands/biggan/search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cli/app/commands/biggan/search.py') 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): -- cgit v1.2.3-70-g09d2