diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-12-19 17:21:43 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-12-19 17:21:43 +0100 |
| commit | 72f4ed218d3d832e2dbf4ee89ffd0b17dd5ad2b9 (patch) | |
| tree | a60b8034e9390a4b75c0641177d86b34cfcf38b2 /inversion | |
| parent | 296bd0c04c10f7d87e0f35402f67530bbd3f3f48 (diff) | |
values
Diffstat (limited to 'inversion')
| -rw-r--r-- | inversion/live.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/inversion/live.py b/inversion/live.py index e5358b1..5dfd7c9 100644 --- a/inversion/live.py +++ b/inversion/live.py @@ -35,6 +35,7 @@ if not os.path.exists(OUTPUT_DIR): # -------------------------- print("Loading module...") generator = hub.Module(str(params.generator_path)) +print("Loaded!") gen_signature = 'generator' if 'generator' not in generator.get_signature_names(): @@ -72,8 +73,8 @@ def normal_z_sample(shape=(BATCH_SIZE, Z_DIM,)): def sin(opts, key, shape): noise = lerp(opts, key + '_noise', shape) - scale = InterpolatorParam(name=key + '_scale') - speed = InterpolatorParam(name=key + '_speed') + scale = InterpolatorParam(name=key + '_scale', value=0.1) + speed = InterpolatorParam(name=key + '_speed', value=1.0) time = opts['time'].variable out = tf.sin(time + noise) * scale.variable opts[key + '_scale'] = scale @@ -83,7 +84,7 @@ def sin(opts, key, shape): def lerp(opts, key, shape): a = InterpolatorParam(name=key + '_a', shape=shape) b = InterpolatorParam(name=key + '_b', shape=shape) - n = InterpolatorParam(name=key + '_n') + n = InterpolatorParam(name=key + '_n', value=0.0) speed = InterpolatorParam(name=key + '_speed') out = a.variable * (1 - n.variable) + b.variable * n.variable opts[key + '_a'] = a @@ -101,7 +102,7 @@ class InterpolatorParam: self.scalar = shape == () self.shape = shape self.type = type - self.value = value or np.zeros(shape) + self.value = value if value is not None else np.zeros(shape) self.variable = tf.placeholder(dtype=dtype, shape=shape) def assign(self, value): |
