GPy/models/new_gp_heteroscedastic_regression.py
def optimize_without_kernels(self, optimizer=None, start=None, **kwargs):
        """
        Optimize the model without the kernels

        kwargs are passed to the optimizer. They can be:

        :param max_f_eval: maximum number of function evaluations
        :type max_f_eval: int
        :messages: whether to display during optimisation
        :type messages: bool
        :param optimizer: which optimizer to use (defaults to self.preferred optimizer)
        :type optimizer: string

        Valid optimizers are:
          - 'scg': scaled conjugate gradient method, recommended for stability.
                   See also GPy.inference.optimization.scg
          - 'fmin_tnc': truncated Newton method (see scipy.optimize.fmin_tnc)
          - 'simplex': the Nelder-Mead simplex method (see scipy.optimize.fmin),
          - 'lbfgsb': the l-bfgs-b method (see scipy.optimize.fmin_l_bfgs_b),
          - 'sgd': stochastic gradient decsent (see scipy.optimize.sgd). For experts only!


        """
        if self.is_fixed or self.size == 0:
            print('nothing to optimize')

        if not self.update_model():
            print("updates were off, setting updates on again")
            self.update_model(True)

        if start == None:
            start = np.hstack([self.Lambda0.flatten(),self.theta1.flatten()])
            start = np.hstack([start,self.theta2.flatten()])
            start = np.hstack([start,self.mean])
        if optimizer is None:
            optimizer = self.preferred_optimizer

        if isinstance(optimizer, optimization.Optimizer):
            opt = optimizer
            opt.model = self
        else:
            optimizer = optimization.get_optimizer(optimizer)
            opt = optimizer(start, model=self,messages=True, **kwargs)

        opt.run(f_fp=self._objective_grads_without_kernels, f=self._objective, fp=self._grads_without_kernels)

        self.optimization_runs.append(opt)

        self.optimizer_array = opt.x_opt

        Optimize the model without the kernels

        kwargs are passed to the optimizer. They can be:

        :param max_f_eval: maximum number of function evaluations
        :type max_f_eval: int
        :messages: whether to display during optimisation
        :type messages: bool
        :param optimizer: which optimizer to use (defaults to self.preferred optimizer)
        :type optimizer: string

        Valid optimizers are:
          - 'scg': scaled conjugate gradient method, recommended for stability.
                   See also GPy.inference.optimization.scg
          - 'fmin_tnc': truncated Newton method (see scipy.optimize.fmin_tnc)
          - 'simplex': the Nelder-Mead simplex method (see scipy.optimize.fmin),
          - 'lbfgsb': the l-bfgs-b method (see scipy.optimize.fmin_l_bfgs_b),
          - 'sgd': stochastic gradient decsent (see scipy.optimize.sgd). For experts only!


        
Optimize the model without the kernels
kwargs are passed to the optimizer. They can be.
Optimize the model without the kernels kwargs are passed to the optimizer . They can be .
def optimize_without_kernels(self, optimizer=None, start=None, **kwargs):
        if self.is_fixed or self.size == 0:
            print('nothing to optimize')
        if not self.update_model():
            print("updates were off, setting updates on again")
            self.update_model(True)
        if start == None:
            start = np.hstack([self.Lambda0.flatten(),self.theta1.flatten()])
            start = np.hstack([start,self.theta2.flatten()])
            start = np.hstack([start,self.mean])
        if optimizer is None:
            optimizer = self.preferred_optimizer
        if isinstance(optimizer, optimization.Optimizer):
            opt = optimizer
            opt.model = self
        else:
            optimizer = optimization.get_optimizer(optimizer)
            opt = optimizer(start, model=self,messages=True, **kwargs)
        opt.run(f_fp=self._objective_grads_without_kernels, f=self._objective, fp=self._grads_without_kernels)
        self.optimization_runs.append(opt)
        self.optimizer_array = opt.x_opt
def optimize_without_kernels ( self , optimizer = None , start = None , ** kwargs ) : if self . is_fixed or self . size == 0 : print ( 'nothing to optimize' ) if not self . update_model ( ) : print ( "updates were off, setting updates on again" ) self . update_model ( True ) if start == None : start = np . hstack ( [ self . Lambda0 . flatten ( ) , self . theta1 . flatten ( ) ] ) start = np . hstack ( [ start , self . theta2 . flatten ( ) ] ) start = np . hstack ( [ start , self . mean ] ) if optimizer is None : optimizer = self . preferred_optimizer if isinstance ( optimizer , optimization . Optimizer ) : opt = optimizer opt . model = self else : optimizer = optimization . get_optimizer ( optimizer ) opt = optimizer ( start , model = self , messages = True , ** kwargs ) opt . run ( f_fp = self . _objective_grads_without_kernels , f = self . _objective , fp = self . _grads_without_kernels ) self . optimization_runs . append ( opt ) self . optimizer_array = opt . x_opt
Optimize the model without the kernels
kwargs are passed to the optimizer.
Optimize the model without the kernels kwargs are passed to the optimizer .
"""
        Optimize the model without the kernels

        kwargs are passed to the optimizer. They can be:

        :param max_f_eval: maximum number of function evaluations
        :type max_f_eval: int
        :messages: whether to display during optimisation
        :type messages: bool
        :param optimizer: which optimizer to use (defaults to self.preferred optimizer)
        :type optimizer: string

        Valid optimizers are:
          - 'scg': scaled conjugate gradient method, recommended for stability.
                   See also GPy.inference.optimization.scg
          - 'fmin_tnc': truncated Newton method (see scipy.optimize.fmin_tnc)
          - 'simplex': the Nelder-Mead simplex method (see scipy.optimize.fmin),
          - 'lbfgsb': the l-bfgs-b method (see scipy.optimize.fmin_l_bfgs_b),
          - 'sgd': stochastic gradient decsent (see scipy.optimize.sgd). For experts only!


        """
self
optimizer
which optimizer to use (defaults to self.preferred optimizer)
which optimizer to use ( defaults to self . preferred optimizer )
self.preferred optimizer)
start
max_f_eval
maximum number of function evaluations
maximum number of function evaluations
messages
whether to display during optimisation
whether to display during optimisation