From c30f09a76aa696c681889d370173a7ce8afabc9d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 10 Jan 2020 14:15:27 +0100 Subject: graph magic --- cli/app/search/live.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 3d884e1..2fd4160 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -222,9 +222,14 @@ class Interpolator: encoding_shape = [1,] + encoding_latent.get_shape().as_list()[1:] print(encoding_shape) + encoding_shape_placeholder = tf.constant(np.zeros(encoding_shape)) encoding_stored = LerpParam('encoding_stored', shape=encoding_shape, datatype="encoding") - encoding_mix = LerpParam('encoding_mix', a_in=encoding_latent, b_in=encoding_stored.output, shape=encoding_shape, datatype="encoding") - tf.contrib.graph_editor.swap_ts(encoding_latent, encoding_mix.output) + encoding_mix = LerpParam('encoding_mix', a_in=encoding_latent, b_in=encoding_shape_placeholder, shape=encoding_shape, datatype="encoding") + # use the placeholder to redirect parts of the graph. + # - computed encoding goes into the encoding_mix + # - encoding mix output goes into the main biggan graph + tf.contrib.graph_editor.swap_ts(encoding_latent, encoding_shape_placeholder) + tf.contrib.graph_editor.swap_ts(encoding_mix.output, encoding_shape_placeholder) sys.stderr.write("Sin params: {}\n".format(", ".join(self.sin_params.keys()))) sys.stderr.write("Lerp params: {}\n".format(", ".join(self.lerp_params.keys()))) -- cgit v1.2.3-70-g09d2