From d4088891e85b048fe42e7cfd5e9cf071ee66f1a7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 18 Jan 2020 16:24:46 +0100 Subject: parameter smoothing --- cli/app/search/live.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'cli/app/search/live.py') diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 202203f..c12063b 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -240,15 +240,15 @@ class Interpolator: z_sum = lerp_z.output + sin_z.output # Latent - saturation - saturation = InterpolatorParam(name='saturation', value=1.0) + saturation = InterpolatorParam(name='saturation', value=1.0, smooth=True) z_abs = z_sum / tf.abs(z_sum) * saturation.variable z_mix = LerpParam('saturation_mix', a_in=z_sum, b_in=z_abs, shape=[BATCH_SIZE, Z_DIM], datatype="input") # Latent - disentangled vectors - zoom = InterpolatorParam(name='zoom', value=0.0).variable * self.disentangled['zoom'] - shiftx = InterpolatorParam(name='shiftx', value=0.0).variable * self.disentangled['shiftx'] - shifty = InterpolatorParam(name='shifty', value=0.0).variable * self.disentangled['shifty'] - luminance = InterpolatorParam(name='luminance', value=0.0).variable * self.disentangled['luminance'] + zoom = InterpolatorParam(name='zoom', value=0.0, smooth=True).variable * self.disentangled['zoom'] + shiftx = InterpolatorParam(name='shiftx', value=0.0, smooth=True).variable * self.disentangled['shiftx'] + shifty = InterpolatorParam(name='shifty', value=0.0, smooth=True).variable * self.disentangled['shifty'] + luminance = InterpolatorParam(name='luminance', value=0.0, smooth=True).variable * self.disentangled['luminance'] disentangled = z_mix.output + zoom + shiftx + shifty + luminance # Latent - stored vector @@ -279,11 +279,10 @@ class Interpolator: encoding_shape_np = tuple([1,] + encoding_shape[1:]) encoding_latent_placeholder = tf.constant(np.zeros(encoding_shape_np, dtype=np.float32)) - # encoding_stored = InterpolatorParam('encoding_stored', shape=encoding_shape_np, datatype="noise") encoding_stored = LerpParam('encoding_stored', shape=encoding_shape_np, datatype="noise") encoding_stored_sin = SinParam('encoding_orbit', shape=encoding_shape_np, datatype="noise", radius=0.05) encoding_stored_sum = encoding_stored.output + encoding_stored_sin.output - encoding_stored_mix = LerpParam('encoding_stored_mix', a_in=encoding_latent_placeholder, b_in=encoding_stored_sum, shape=encoding_shape_np, datatype="encoding", smooth=True) + encoding_stored_mix = LerpParam('encoding_stored_mix', a_in=encoding_latent_placeholder, b_in=encoding_stored_sum, shape=encoding_shape_np, datatype="encoding") # Use the placeholder to redirect parts of the graph. # - computed encoding goes into the encoding_mix -- cgit v1.2.3-70-g09d2