autogp/gaussian_process.py
def fit(self, data, optimizer, loo_steps=10,  var_steps=10, epochs=200,
            batch_size=None, display_step=1, test=None, loss=None):
        """
        Fit the Gaussian process model to the given data.

        Parameters
        ----------
        data : subclass of datasets.DataSet
            The train inputs and outputs.
        optimizer : TensorFlow optimizer
            The optimizer to use in the fitting process.
        loo_steps : int
            Number of steps  to update hyper-parameters using loo objective
        var_steps : int
            Number of steps to update  variational parameters using variational
            objective (elbo).
        epochs : int
            The number of epochs to optimize the model for.
        batch_size : int
            The number of datapoints to use per mini-batch when training.
            If batch_size is None,
            then we perform batch gradient descent.
        display_step : int
            The frequency at which the objective values are printed out.
        """
        num_train = data.num_examples
        if batch_size is None:
            batch_size = num_train

        if self.optimizer != optimizer:
            self.optimizer = optimizer
            self.loo_train_step = optimizer.minimize(
                self.loo_loss, var_list=[
                    self.raw_inducing_inputs
                ] +
                self.raw_kernel_params +
                self.raw_likelihood_params
            )
            self.train_step = optimizer.minimize(self.nelbo)
            self.session.run(tf.global_variables_initializer())

        start = data.next_batch(batch_size)

        old_epoch = 0
        while data.epochs_completed < epochs:
            num_epochs = data.epochs_completed + var_steps
            while data.epochs_completed < num_epochs:
                batch = data.next_batch(batch_size)
                self.session.run(
                    self.train_step,
                    feed_dict={
                        self.train_inputs: batch[0],
                        self.train_outputs: batch[1],
                        self.num_train: num_train})
                if (data.epochs_completed % display_step == 0
                        and data.epochs_completed != old_epoch):
                    self._print_state(data, test, loss, num_train)
                    old_epoch = data.epochs_completed

            num_epochs = data.epochs_completed + loo_steps
            while data.epochs_completed < num_epochs:
                batch = data.next_batch(batch_size)
                self.session.run(self.loo_train_step, feed_dict={
                    self.train_inputs: batch[0],
                    self.train_outputs: batch[1],
                    self.num_train: num_train})
                if (
                        data.epochs_completed % display_step == 0 and
                        data.epochs_completed != old_epoch):
                    self._print_state(data, test, loss, num_train)
                    old_epoch = data.epochs_completed

        Fit the Gaussian process model to the given data.

        Parameters
        ----------
        data : subclass of datasets.DataSet
            The train inputs and outputs.
        optimizer : TensorFlow optimizer
            The optimizer to use in the fitting process.
        loo_steps : int
            Number of steps  to update hyper-parameters using loo objective
        var_steps : int
            Number of steps to update  variational parameters using variational
            objective (elbo).
        epochs : int
            The number of epochs to optimize the model for.
        batch_size : int
            The number of datapoints to use per mini-batch when training.
            If batch_size is None,
            then we perform batch gradient descent.
        display_step : int
            The frequency at which the objective values are printed out.
        
Fit the Gaussian process model to the given data.
Parameters

data : subclass of datasets.DataSet
The train inputs and outputs.
optimizer : TensorFlow optimizer
The optimizer to use in the fitting process.
loo_steps : int
Number of steps  to update hyper-parameters using loo objective
var_steps : int
Number of steps to update  variational parameters using variational
objective (elbo).
epochs : int
The number of epochs to optimize the model for.
batch_size : int
The number of datapoints to use per mini-batch when training.
If batch_size is None,
then we perform batch gradient descent.
display_step : int
The frequency at which the objective values are printed out.
Fit the Gaussian process model to the given data . Parameters data : subclass of datasets . DataSet The train inputs and outputs . optimizer : TensorFlow optimizer The optimizer to use in the fitting process . loo_steps : int Number of steps to update hyper - parameters using loo objective var_steps : int Number of steps to update variational parameters using variational objective ( elbo ) . epochs : int The number of epochs to optimize the model for . batch_size : int The number of datapoints to use per mini - batch when training . If batch_size is None then we perform batch gradient descent . display_step : int The frequency at which the objective values are printed out .
def fit(self, data, optimizer, loo_steps=10,  var_steps=10, epochs=200,
            batch_size=None, display_step=1, test=None, loss=None):
        num_train = data.num_examples
        if batch_size is None:
            batch_size = num_train
        if self.optimizer != optimizer:
            self.optimizer = optimizer
            self.loo_train_step = optimizer.minimize(
                self.loo_loss, var_list=[
                    self.raw_inducing_inputs
                ] +
                self.raw_kernel_params +
                self.raw_likelihood_params
            )
            self.train_step = optimizer.minimize(self.nelbo)
            self.session.run(tf.global_variables_initializer())
        start = data.next_batch(batch_size)
        old_epoch = 0
        while data.epochs_completed < epochs:
            num_epochs = data.epochs_completed + var_steps
            while data.epochs_completed < num_epochs:
                batch = data.next_batch(batch_size)
                self.session.run(
                    self.train_step,
                    feed_dict={
                        self.train_inputs: batch[0],
                        self.train_outputs: batch[1],
                        self.num_train: num_train})
                if (data.epochs_completed % display_step == 0
                        and data.epochs_completed != old_epoch):
                    self._print_state(data, test, loss, num_train)
                    old_epoch = data.epochs_completed
            num_epochs = data.epochs_completed + loo_steps
            while data.epochs_completed < num_epochs:
                batch = data.next_batch(batch_size)
                self.session.run(self.loo_train_step, feed_dict={
                    self.train_inputs: batch[0],
                    self.train_outputs: batch[1],
                    self.num_train: num_train})
                if (
                        data.epochs_completed % display_step == 0 and
                        data.epochs_completed != old_epoch):
                    self._print_state(data, test, loss, num_train)
                    old_epoch = data.epochs_completed
def fit ( self , data , optimizer , loo_steps = 10 , var_steps = 10 , epochs = 200 , batch_size = None , display_step = 1 , test = None , loss = None ) : num_train = data . num_examples if batch_size is None : batch_size = num_train if self . optimizer != optimizer : self . optimizer = optimizer self . loo_train_step = optimizer . minimize ( self . loo_loss , var_list = [ self . raw_inducing_inputs ] + self . raw_kernel_params + self . raw_likelihood_params ) self . train_step = optimizer . minimize ( self . nelbo ) self . session . run ( tf . global_variables_initializer ( ) ) start = data . next_batch ( batch_size ) old_epoch = 0 while data . epochs_completed < epochs : num_epochs = data . epochs_completed + var_steps while data . epochs_completed < num_epochs : batch = data . next_batch ( batch_size ) self . session . run ( self . train_step , feed_dict = { self . train_inputs : batch [ 0 ] , self . train_outputs : batch [ 1 ] , self . num_train : num_train } ) if ( data . epochs_completed % display_step == 0 and data . epochs_completed != old_epoch ) : self . _print_state ( data , test , loss , num_train ) old_epoch = data . epochs_completed num_epochs = data . epochs_completed + loo_steps while data . epochs_completed < num_epochs : batch = data . next_batch ( batch_size ) self . session . run ( self . loo_train_step , feed_dict = { self . train_inputs : batch [ 0 ] , self . train_outputs : batch [ 1 ] , self . num_train : num_train } ) if ( data . epochs_completed % display_step == 0 and data . epochs_completed != old_epoch ) : self . _print_state ( data , test , loss , num_train ) old_epoch = data . epochs_completed
Fit the Gaussian process model to the given data.
Fit the Gaussian process model to the given data .
"""
        Fit the Gaussian process model to the given data.

        Parameters
        ----------
        data : subclass of datasets.DataSet
            The train inputs and outputs.
        optimizer : TensorFlow optimizer
            The optimizer to use in the fitting process.
        loo_steps : int
            Number of steps  to update hyper-parameters using loo objective
        var_steps : int
            Number of steps to update  variational parameters using variational
            objective (elbo).
        epochs : int
            The number of epochs to optimize the model for.
        batch_size : int
            The number of datapoints to use per mini-batch when training.
            If batch_size is None,
            then we perform batch gradient descent.
        display_step : int
            The frequency at which the objective values are printed out.
        """
self
data
optimizer
loo_steps
var_steps
epochs
batch_size
display_step
test
loss