Package linear_operators :: Package iterative :: Module algorithms :: Class ConjugateGradient
[hide private]
[frames] | no frames]

Class ConjugateGradient

source code

object --+    
         |    
 Algorithm --+
             |
            ConjugateGradient
Known Subclasses:


Apply the conjugate gradient algorithm to a Criterion instance.

Parameters
----------

criterion : Criterion
    A Criterion instance. It should have following methods and attributes:
        __call__ : returns criterion values at given point
        gradient : returns gradient (1st derivative) of criterion at given point
        n_variable: the size of the input vector of criterion

x0 : ndarray (None)
    The first guess of the algorithm.

callback : function (default_callback)
    Perform some printing / saving operations at each iteration.

stop_condition : function (default_stop)
    Defines when the iterations should stop

update_type : function (fletcher_reeves)
    Type of descent direction update : e.g. fletcher_reeves, polak_ribiere

line_search : function (optimal step)
    Line search method to find the minimum along each direction at each
    iteration.

Returns
-------

Returns an algorithm instance. Optimization is performed by
calling the this instance.

Instance Methods [hide private]
 
__init__(self, criterion, x0=None, callback=default_callback, stop_condition=default_stop, update_type=<function fletcher_reeves at 0x2aade60>, line_search=<function optimal_step at 0x28b4848>, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
initialize(self)
Initialize required values.
source code
 
first_guess(self, x0=None)
Sets current_solution attribute to initial value.
source code
 
update_gradient(self) source code
 
update_gradient_norm(self) source code
 
update_descent(self) source code
 
update_solution(self) source code
 
update_criterion(self) source code
 
iterate(self)
Update all values.
source code

Inherited from Algorithm: __call__, at_exit, callback, cont

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, criterion, x0=None, callback=default_callback, stop_condition=default_stop, update_type=<function fletcher_reeves at 0x2aade60>, line_search=<function optimal_step at 0x28b4848>, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

initialize(self)

source code 

Initialize required values.

Overrides: Algorithm.initialize

iterate(self)

source code 

Update all values.

Overrides: Algorithm.iterate