fides/stepback.py
def stepback_reflect(tr_step: Step,
                     x: np.ndarray,
                     sg: np.ndarray,
                     hess: np.ndarray,
                     scaling: csc_matrix,
                     g_dscaling: csc_matrix,
                     delta: float,
                     theta: float,
                     ub: np.ndarray,
                     lb: np.ndarray) -> List[Step]:
    """
    Compute new proposal steps according to a reflection strategy.

    :param tr_step:
        Reference trust region step that will be reflected
    :param x:
        Current values of the optimization variables
    :param sg:
        Rescaled objective function gradient at x
    :param hess:
        (Approximate) objective function Hessian at x
    :param g_dscaling:
        Unscaled gradient multiplied by derivative of scaling
        transformation
    :param scaling:
        Scaling transformation according to distance to boundary
    :param delta:
        Trust region radius, note that this applies after scaling
        transformation
    :param theta:
        parameter regulating stepback
    :param lb:
        lower optimization variable boundaries
    :param ub:
        upper optimization variable boundaries

    :return:
        New proposal steps
    """
    rtr_step = TRStepReflected(x, sg, hess, scaling, g_dscaling, delta,
                               theta, ub, lb, tr_step)
    rtr_step.calculate()
    steps = [rtr_step]
    for ireflection in range(len(x) - 1):
        if rtr_step.alpha == 1.0:
            break
        # recursively add more reflections
        rtr_old = rtr_step
        rtr_step = TRStepReflected(x, sg, hess, scaling, g_dscaling, delta,
                                   theta, ub, lb, rtr_old)
        rtr_step.calculate()
        steps.append(rtr_step)

    return steps

    Compute new proposal steps according to a reflection strategy.

    :param tr_step:
        Reference trust region step that will be reflected
    :param x:
        Current values of the optimization variables
    :param sg:
        Rescaled objective function gradient at x
    :param hess:
        (Approximate) objective function Hessian at x
    :param g_dscaling:
        Unscaled gradient multiplied by derivative of scaling
        transformation
    :param scaling:
        Scaling transformation according to distance to boundary
    :param delta:
        Trust region radius, note that this applies after scaling
        transformation
    :param theta:
        parameter regulating stepback
    :param lb:
        lower optimization variable boundaries
    :param ub:
        upper optimization variable boundaries

    :return:
        New proposal steps
    
Compute new proposal steps according to a reflection strategy.
Compute new proposal steps according to a reflection strategy .
def stepback_reflect(tr_step: Step,
                     x: np.ndarray,
                     sg: np.ndarray,
                     hess: np.ndarray,
                     scaling: csc_matrix,
                     g_dscaling: csc_matrix,
                     delta: float,
                     theta: float,
                     ub: np.ndarray,
                     lb: np.ndarray) -> List[Step]:
    rtr_step = TRStepReflected(x, sg, hess, scaling, g_dscaling, delta,
                               theta, ub, lb, tr_step)
    rtr_step.calculate()
    steps = [rtr_step]
    for ireflection in range(len(x) - 1):
        if rtr_step.alpha == 1.0:
            break
        rtr_old = rtr_step
        rtr_step = TRStepReflected(x, sg, hess, scaling, g_dscaling, delta,
                                   theta, ub, lb, rtr_old)
        rtr_step.calculate()
        steps.append(rtr_step)
    return steps
def stepback_reflect ( tr_step : Step , x : np . ndarray , sg : np . ndarray , hess : np . ndarray , scaling : csc_matrix , g_dscaling : csc_matrix , delta : float , theta : float , ub : np . ndarray , lb : np . ndarray ) -> List [ Step ] : rtr_step = TRStepReflected ( x , sg , hess , scaling , g_dscaling , delta , theta , ub , lb , tr_step ) rtr_step . calculate ( ) steps = [ rtr_step ] for ireflection in range ( len ( x ) - 1 ) : if rtr_step . alpha == 1.0 : break rtr_old = rtr_step rtr_step = TRStepReflected ( x , sg , hess , scaling , g_dscaling , delta , theta , ub , lb , rtr_old ) rtr_step . calculate ( ) steps . append ( rtr_step ) return steps
Compute new proposal steps according to a reflection strategy.
Compute new proposal steps according to a reflection strategy .
"""
    Compute new proposal steps according to a reflection strategy.

    :param tr_step:
        Reference trust region step that will be reflected
    :param x:
        Current values of the optimization variables
    :param sg:
        Rescaled objective function gradient at x
    :param hess:
        (Approximate) objective function Hessian at x
    :param g_dscaling:
        Unscaled gradient multiplied by derivative of scaling
        transformation
    :param scaling:
        Scaling transformation according to distance to boundary
    :param delta:
        Trust region radius, note that this applies after scaling
        transformation
    :param theta:
        parameter regulating stepback
    :param lb:
        lower optimization variable boundaries
    :param ub:
        upper optimization variable boundaries

    :return:
        New proposal steps
    """ # recursively add more reflections
New proposal steps
New proposal steps
tr_step
Step
Reference trust region step that will be reflected
Reference trust region step that will be reflected
x
np.ndarray
Current values of the optimization variables
Current values of the optimization variables
sg
np.ndarray
Rescaled objective function gradient at x
Rescaled objective function gradient at x
hess
np.ndarray
(Approximate) objective function Hessian at x
( Approximate ) objective function Hessian at x
scaling
csc_matrix
Scaling transformation according to distance to boundary
Scaling transformation according to distance to boundary
g_dscaling
csc_matrix
Unscaled gradient multiplied by derivative of scaling
transformation
Unscaled gradient multiplied by derivative of scaling transformation
delta
float
Trust region radius, note that this applies after scaling
transformation
Trust region radius note that this applies after scaling transformation
theta
float
parameter regulating stepback
parameter regulating stepback
ub
np.ndarray
upper optimization variable boundaries
upper optimization variable boundaries
lb
np.ndarray
lower optimization variable boundaries
lower optimization variable boundaries