Commit e9f4ee9f authored by PhilFischer's avatar PhilFischer
Browse files

Initialize sigma value close to optimum

parent 12e6dc68
......@@ -68,20 +68,20 @@ hparams = [
hp.HParam('architecture', hp.Discrete(['σ-VAE-1'])),
hp.HParam('likelihood', hp.Discrete(['sigma'])),
hp.HParam('log_lr', hp.RealInterval(-5.6, -3.6)),
hp.HParam('latent_dim', hp.IntInterval(8, 16)),
hp.HParam('feature_layers', hp.IntInterval(1, 2)),
hp.HParam('latent_dim', hp.IntInterval(8, 8)),
hp.HParam('feature_layers', hp.IntInterval(2, 3)),
hp.HParam('style_layers', hp.IntInterval(1, 1)),
hp.HParam('encoder_layers', hp.IntInterval(1, 3)),
hp.HParam('decoder_layers', hp.IntInterval(1, 4)),
hp.HParam('encoder_layers', hp.IntInterval(2, 3)),
hp.HParam('decoder_layers', hp.IntInterval(2, 4)),
hp.HParam('feature_filters', hp.IntInterval(12, 32)),
hp.HParam('encoder_filters', hp.IntInterval(8, 20)),
hp.HParam('decoder_filters', hp.IntInterval(16, 96)),
hp.HParam('decoder_filters', hp.IntInterval(16, 64)),
hp.HParam('feature_kernel_size', hp.IntInterval(3, 3)),
hp.HParam('encoder_kernel_size', hp.IntInterval(3, 3)),
hp.HParam('decoder_kernel_size', hp.IntInterval(3, 3)),
hp.HParam('feature_multiple', hp.IntInterval(1, 1)),
hp.HParam('encoder_multiple', hp.IntInterval(1, 1)),
hp.HParam('decoder_multiple', hp.IntInterval(1, 1))
hp.HParam('feature_multiple', hp.IntInterval(1, 2)),
hp.HParam('encoder_multiple', hp.IntInterval(1, 2)),
hp.HParam('decoder_multiple', hp.IntInterval(1, 2))
]
metrics = [
hp.Metric('epoch_loss', group='train', display_name='Train ELBO'),
......@@ -94,7 +94,7 @@ log_dir = 'logs'
ex_name = os.path.join('ex03', datetime.now().strftime("%y%m%d-%H%M%S"))
tuner = Tuner((train, s_train), (test, s_test), define_model, hparams, metrics, log_dir, seed=SEED)
tuner.tune(ex_name, runs=20, epochs=1000)
tuner.tune(ex_name, runs=10, epochs=1000)
if tuner.best_model is None:
print('\n*** No model gave finite results. Report omitted.')
......
......@@ -50,7 +50,7 @@ class VAE(Model):
self._connect = DistributionLambda(make_normal_distr(self.__log_scale, reinterpreted_batch_ndims=len(shape)))
elif likelihood == 'sigma':
param_shape = shape
self.__log_scale = tf.Variable(0., trainable=True)
self.__log_scale = tf.Variable(-1.8, trainable=True)
self._connect = DistributionLambda(make_normal_distr(self.__log_scale, reinterpreted_batch_ndims=len(shape)))
elif likelihood == 'kumaraswamy':
cdim = shape[-1]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment