Ejemplo n.º 1
0
    def setUp(self):
        self.session = tf.Session()

        self.kern = gplvm.SEKernel(session=self.session)

        shape = (8, 3)
        self.X = tf.constant(np.random.uniform(size=shape), dtype=c.float_type)
        self.Y = tf.constant(np.random.uniform(size=shape), dtype=c.float_type)

        self.session.run(tf.global_variables_initializer())
Ejemplo n.º 2
0
    output_dir=flags['latent_samples_dir'])

training_data = Data(flags['training_data'],
                     shuffle_first=flags['shuffle_data'],
                     batch_size=flags['training_batch_size'],
                     log_epochs=flags['data_log_epochs'],
                     name='TrainingData')

Y = training_data.next_batch()

config = tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True))
session = tf.Session(config=config)

kern = gplvm.SEKernel(session=session,
                      alpha=flags['kernel_alpha'],
                      gamma=flags['kernel_gamma'],
                      ARD=flags['kernel_ard'],
                      Q=flags['q'])

layer = gplvm.GPLVM(Y=Y,
                    Q=flags['q'],
                    kern=kern,
                    noise_variance=flags['noise_variance'],
                    latent_point_plotter=lp_plotter,
                    latent_sample_plotter=ls_plotter,
                    session=session,
                    name=flags['gplvm_name'])

layer.build_model()

optimizer = tf.train.AdamOptimizer(learning_rate=flags['learning_rate'])