summaryrefslogtreecommitdiff
path: root/cli/app
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-10 14:15:27 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-10 14:15:27 +0100
commitc30f09a76aa696c681889d370173a7ce8afabc9d (patch)
treeb94cc0c8e14b073f92871167fb7205337ea56a69 /cli/app
parent3d093654f101fd409cfebae61d1f555a8f44194d (diff)
graph magic
Diffstat (limited to 'cli/app')
-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())))