Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
scipy
/
optimize
/
__pycache__
/
File Content:
_trustregion_dogleg.cpython-35.pyc
�<WWa � @ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z m Z g Z f d d d d � Z Gd d � d e � Z d S) z"Dog-leg trust-region optimization.� )�division�print_function�absolute_importN� )�_minimize_trust_region�BaseQuadraticSubproblemc K sX | d k r t d � � | d k r0 t d � � t | | d | d | d | d t | �S)a Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm. Options ------- initial_trust_radius : float Initial trust-region radius. max_trust_radius : float Maximum value of the trust-region radius. No steps that are longer than this value will be proposed. eta : float Trust region related acceptance stringency for proposed steps. gtol : float Gradient norm must be less than `gtol` before successful termination. Nz,Jacobian is required for dogleg minimizationz+Hessian is required for dogleg minimization�args�jac�hessZ subproblem)� ValueErrorr �DoglegSubproblem)ZfunZx0r r r Ztrust_region_options� r �/_trustregion_dogleg.py�_minimize_dogleg s r c @ s: e Z d Z d Z d d � Z d d � Z d d � Z d S) r z0Quadratic subproblem solved by the dogleg methodc C sX | j d k rQ | j } | j | � } t j | | � t j | | � | | _ | j S)zV The Cauchy point is minimal along the direction of steepest descent. N)Z _cauchy_pointr Zhessp�np�dot)�self�gZBgr r r �cauchy_point+ s *zDoglegSubproblem.cauchy_pointc C sS | j d k rL | j } | j } t j j | � } t j j | | � | _ | j S)zS The Newton point is a global minimum of the approximate function. N)Z _newton_pointr r �scipy�linalgZ cho_factorZ cho_solve)r r �BZcho_infor r r �newton_point5 s zDoglegSubproblem.newton_pointc C s� | j � } t j j | � | k r4 d } | | f S| j � } t j j | � } | | k r| | | | } d } | | f S| j | | | | � \ } } | | | | } d } | | f S)a� Minimize a function using the dog-leg trust-region algorithm. This algorithm requires function values and first and second derivatives. It also performs a costly Hessian decomposition for most iterations, and the Hessian is required to be positive definite. Parameters ---------- trust_radius : float We are allowed to wander only this far away from the origin. Returns ------- p : ndarray The proposed step. hits_boundary : bool True if the proposed step is on the boundary of the trust region. Notes ----- The Hessian is required to be positive definite. References ---------- .. [1] Jorge Nocedal and Stephen Wright, Numerical Optimization, second edition, Springer-Verlag, 2006, page 73. FT)r r r Znormr Zget_boundaries_intersections) r Ztrust_radiusZp_bestZ hits_boundaryZp_uZp_u_normZ p_boundary�_�tbr r r �solve@ s " zDoglegSubproblem.solveN)�__name__� __module__�__qualname__�__doc__r r r r r r r r ( s r )r Z __future__r r r Znumpyr Zscipy.linalgr Z_trustregionr r �__all__r r r r r r �<module> s
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
__init__.cpython-35.opt-1.pyc
6964 bytes
0644
__init__.cpython-35.pyc
6964 bytes
0644
_basinhopping.cpython-35.opt-1.pyc
24677 bytes
0644
_basinhopping.cpython-35.pyc
24677 bytes
0644
_differentialevolution.cpython-35.opt-1.pyc
26738 bytes
0644
_differentialevolution.cpython-35.pyc
26738 bytes
0644
_hungarian.cpython-35.opt-1.pyc
7804 bytes
0644
_hungarian.cpython-35.pyc
7804 bytes
0644
_linprog.cpython-35.opt-1.pyc
31172 bytes
0644
_linprog.cpython-35.pyc
31172 bytes
0644
_minimize.cpython-35.opt-1.pyc
24043 bytes
0644
_minimize.cpython-35.pyc
24043 bytes
0644
_numdiff.cpython-35.opt-1.pyc
18899 bytes
0644
_numdiff.cpython-35.pyc
18899 bytes
0644
_root.cpython-35.opt-1.pyc
25483 bytes
0644
_root.cpython-35.pyc
25483 bytes
0644
_spectral.cpython-35.opt-1.pyc
7761 bytes
0644
_spectral.cpython-35.pyc
7761 bytes
0644
_trustregion.cpython-35.opt-1.pyc
7169 bytes
0644
_trustregion.cpython-35.pyc
7169 bytes
0644
_trustregion_dogleg.cpython-35.opt-1.pyc
3735 bytes
0644
_trustregion_dogleg.cpython-35.pyc
3735 bytes
0644
_trustregion_ncg.cpython-35.opt-1.pyc
3464 bytes
0644
_trustregion_ncg.cpython-35.pyc
3464 bytes
0644
_tstutils.cpython-35.opt-1.pyc
1995 bytes
0644
_tstutils.cpython-35.pyc
1995 bytes
0644
cobyla.cpython-35.opt-1.pyc
9239 bytes
0644
cobyla.cpython-35.pyc
9239 bytes
0644
lbfgsb.cpython-35.opt-1.pyc
15952 bytes
0644
lbfgsb.cpython-35.pyc
15952 bytes
0644
linesearch.cpython-35.opt-1.pyc
18967 bytes
0644
linesearch.cpython-35.pyc
18967 bytes
0644
minpack.cpython-35.opt-1.pyc
28403 bytes
0644
minpack.cpython-35.pyc
28403 bytes
0644
nnls.cpython-35.opt-1.pyc
1659 bytes
0644
nnls.cpython-35.pyc
1659 bytes
0644
nonlin.cpython-35.opt-1.pyc
47479 bytes
0644
nonlin.cpython-35.pyc
47545 bytes
0644
optimize.cpython-35.opt-1.pyc
83901 bytes
0644
optimize.cpython-35.pyc
83901 bytes
0644
setup.cpython-35.opt-1.pyc
2801 bytes
0644
setup.cpython-35.pyc
2801 bytes
0644
slsqp.cpython-35.opt-1.pyc
15484 bytes
0644
slsqp.cpython-35.pyc
15484 bytes
0644
tnc.cpython-35.opt-1.pyc
13998 bytes
0644
tnc.cpython-35.pyc
13998 bytes
0644
zeros.cpython-35.opt-1.pyc
19335 bytes
0644
zeros.cpython-35.pyc
19335 bytes
0644
N4ST4R_ID | Naxtarrr