summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/app/search/live.py9
1 files changed, 7 insertions, 2 deletions
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())))