fides/minimize.py
def update(self,
               step: Step,
               x_new: np.ndarray,
               fval_new: float,
               grad_new: np.ndarray,
               hess_new: Optional[np.ndarray] = None) -> None:
        """
        Update self according to employed step

        :param step:
            Employed step
        :param x_new:
            New optimization variable values
        :param fval_new:
            Objective function value at x_new
        :param grad_new:
            Objective function gradient at x_new
        :param hess_new:
            (Approximate) objective function Hessian at x_new
        """
        if self.hessian_update is not None:
            self.hessian_update.update(step.s + step.s0,
                                       grad_new - self.grad)

        if self.hessian_update is None or \
                (isinstance(self.hessian_update, HybridUpdate) and
                 (self.iterations_since_tr_update <
                  self.hessian_update.switch_iteration and not
                  self.hybrid_switch)):
            self.hess = hess_new
        else:
            if not self.hybrid_switch:
                self.logger.info('Hybrid switchpoint reached.')
            self.hybrid_switch = True
            self.hess = self.hessian_update.get_mat()
        self.check_in_bounds(x_new)
        self.fval = fval_new
        self.x = x_new
        self.grad = grad_new
        self.check_finite()
        self.make_non_degenerate()

        Update self according to employed step

        :param step:
            Employed step
        :param x_new:
            New optimization variable values
        :param fval_new:
            Objective function value at x_new
        :param grad_new:
            Objective function gradient at x_new
        :param hess_new:
            (Approximate) objective function Hessian at x_new
        
Update self according to employed step
Update self according to employed step
def update(self,
               step: Step,
               x_new: np.ndarray,
               fval_new: float,
               grad_new: np.ndarray,
               hess_new: Optional[np.ndarray] = None) -> None:
        if self.hessian_update is not None:
            self.hessian_update.update(step.s + step.s0,
                                       grad_new - self.grad)
        if self.hessian_update is None or \
                (isinstance(self.hessian_update, HybridUpdate) and
                 (self.iterations_since_tr_update <
                  self.hessian_update.switch_iteration and not
                  self.hybrid_switch)):
            self.hess = hess_new
        else:
            if not self.hybrid_switch:
                self.logger.info('Hybrid switchpoint reached.')
            self.hybrid_switch = True
            self.hess = self.hessian_update.get_mat()
        self.check_in_bounds(x_new)
        self.fval = fval_new
        self.x = x_new
        self.grad = grad_new
        self.check_finite()
        self.make_non_degenerate()
def update ( self , step : Step , x_new : np . ndarray , fval_new : float , grad_new : np . ndarray , hess_new : Optional [ np . ndarray ] = None ) -> None : if self . hessian_update is not None : self . hessian_update . update ( step . s + step . s0 , grad_new - self . grad ) if self . hessian_update is None or ( isinstance ( self . hessian_update , HybridUpdate ) and ( self . iterations_since_tr_update < self . hessian_update . switch_iteration and not self . hybrid_switch ) ) : self . hess = hess_new else : if not self . hybrid_switch : self . logger . info ( 'Hybrid switchpoint reached.' ) self . hybrid_switch = True self . hess = self . hessian_update . get_mat ( ) self . check_in_bounds ( x_new ) self . fval = fval_new self . x = x_new self . grad = grad_new self . check_finite ( ) self . make_non_degenerate ( )
Update self according to employed step
Update self according to employed step
"""
        Update self according to employed step

        :param step:
            Employed step
        :param x_new:
            New optimization variable values
        :param fval_new:
            Objective function value at x_new
        :param grad_new:
            Objective function gradient at x_new
        :param hess_new:
            (Approximate) objective function Hessian at x_new
        """
self
step
Step
None
x_new
np.ndarray
New optimization variable values
New optimization variable values
fval_new
float
Objective function value at x_new
Objective function value at x_new
grad_new
np.ndarray
Objective function gradient at x_new
Objective function gradient at x_new
hess_new
Optional[np.ndarray]
(Approximate) objective function Hessian at x_new
( Approximate ) objective function Hessian at x_new