fides/stepback.py
def stepback_refine(steps: Sequence[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]:
    """
    Refine a promising subset of the provided steps based on trust-constr
    optimization

    :param steps:
        Reference trust region step that will be reflect
    :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
    """
    idx = np.nanargmin([step.qpval for step in steps])
    step = RefinedStep(
        x, sg, hess, scaling, g_dscaling, delta, theta, ub, lb, steps[idx]
    )
    step.calculate()
    return [step]

    Refine a promising subset of the provided steps based on trust-constr
    optimization

    :param steps:
        Reference trust region step that will be reflect
    :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
    
Refine a promising subset of the provided steps based on trust-constr
optimization
Refine a promising subset of the provided steps based on trust - constr optimization
def stepback_refine(steps: Sequence[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]:
    idx = np.nanargmin([step.qpval for step in steps])
    step = RefinedStep(
        x, sg, hess, scaling, g_dscaling, delta, theta, ub, lb, steps[idx]
    )
    step.calculate()
    return [step]
def stepback_refine ( steps : Sequence [ 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 ] : idx = np . nanargmin ( [ step . qpval for step in steps ] ) step = RefinedStep ( x , sg , hess , scaling , g_dscaling , delta , theta , ub , lb , steps [ idx ] ) step . calculate ( ) return [ step ]
Refine a promising subset of the provided steps based on trust-constr
optimization
Refine a promising subset of the provided steps based on trust - constr optimization
"""
    Refine a promising subset of the provided steps based on trust-constr
    optimization

    :param steps:
        Reference trust region step that will be reflect
    :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
    """
New proposal steps
New proposal steps
steps
Sequence[Step]
Reference trust region step that will be reflect
Reference trust region step that will be reflect
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