diff options
| -rw-r--r-- | inversion/live.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/inversion/live.py b/inversion/live.py index 0fdad7c..3ca7717 100644 --- a/inversion/live.py +++ b/inversion/live.py @@ -13,7 +13,6 @@ tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../live-cortex/rpc/')) from rpc import CortexRPC -from listener import Listener from params import Params params = Params('params_dense.json') @@ -85,22 +84,21 @@ class InterpolatorParam: class Interpolator: def __init__(self): - self.opts = {} - self.t = time.time() - - def build(self): - opts = { + self.opts = { 'global': { 'time': InterpolatorParam(name='t', value=time.time()) }, } - lerp_z = lerp(opts, 'latent', [BATCH_SIZE, Z_DIM]) - sin_z = sin(opts, 'sin_z', [BATCH_SIZE, Z_DIM]) - lerp_label = lerp(opts, 'label', [BATCH_SIZE, N_CLASS]) - opts['threshold'] = InterpolatorParam('threshold', value=1.0) + self.t = time.time() + + def build(self): + lerp_z = lerp(self.opts, 'latent', [BATCH_SIZE, Z_DIM]) + sin_z = sin(self.opts, 'sin_z', [BATCH_SIZE, Z_DIM]) + lerp_label = lerp(self.opts, 'label', [BATCH_SIZE, N_CLASS]) + self.opts['threshold'] = InterpolatorParam('threshold', value=1.0) gen_in = {} - gen_in['threshold'] = opts['threshold'].variable + gen_in['threshold'] = self.opts['threshold'].variable gen_in['z'] = lerp_z + sin_z gen_in['y'] = lerp_label gen_img = generator(gen_in, signature=gen_signature) |
