Package parsimony :: Package algorithms :: Module utils :: Class BacktrackingLineSearch
[hide private]
[frames] | no frames]

Class BacktrackingLineSearch

source code

         object --+        
                  |        
bases.BaseAlgorithm --+    
                      |    
bases.ExplicitAlgorithm --+
                          |
                         BacktrackingLineSearch

Finds a step length a that fulfills a given descent criterion.

Instance Methods [hide private]
 
__init__(self, condition=None, output=False, max_iter=30, min_iter=1, eps=5e-08)
Parameters ---------- condition : The class of the descent condition.
source code
 
run(self, function, x, p, rho=0.5, a=1.0, condition_params={})
Finds the step length for a descent algorithm.
source code

Inherited from bases.BaseAlgorithm: get_params, set_params

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from bases.BaseAlgorithm: check_compatibility

Class Variables [hide private]
  INTERFACES = [<class 'parsimony.functions.properties.Function'...
  __abstractmethods__ = frozenset([])

Inherited from bases.ExplicitAlgorithm: __metaclass__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, condition=None, output=False, max_iter=30, min_iter=1, eps=5e-08)
(Constructor)

source code 

Parameters
----------
condition : The class of the descent condition. If not given, defaults
        to the SufficientDescentCondition.

output : Boolean. Whether or not to return additional output.

max_iter : Non-negative integer. The maximum allowed number of
        iterations.

min_iter : Non-negative integer, min_iter <= max_iter. The minimum
        number of iterations that must be made.

Overrides: object.__init__

run(self, function, x, p, rho=0.5, a=1.0, condition_params={})

source code 
Finds the step length for a descent algorithm.

Parameters
----------
function : A Loss function. The function to minimise.

x : Numpy array. The current point.

p : Numpy array. The descent direction.

rho : Float, 0 < rho < 1. The rate at which to decrease a in each
        iteration. Smaller will finish faster, but may yield a lesser
        descent.

a : Float. The upper bound on the step length. Defaults to 1.0, which
        is suitable for e.g. Newton's method.

condition_params : Dictionary. Parameters for the descent condition.

Overrides: bases.ExplicitAlgorithm.run

Class Variable Details [hide private]

INTERFACES

Value:
[<class 'parsimony.functions.properties.Function'>,
 <class 'parsimony.functions.properties.Gradient'>]