wolffd@0: wolffd@0:
wolffd@0:[x, options, flog, pointlog] = conjgrad(f, x, options, gradf)
uses a
wolffd@0: conjugate gradients
wolffd@0: algorithm to find the minimum of the function f(x)
whose
wolffd@0: gradient is given by gradf(x)
. Here x
is a row vector
wolffd@0: and f
returns a scalar value.
wolffd@0: The point at which f
has a local minimum
wolffd@0: is returned as x
. The function value at that point is returned
wolffd@0: in options(8)
. A log of the function values
wolffd@0: after each cycle is (optionally) returned in flog
, and a log
wolffd@0: of the points visited is (optionally) returned in pointlog
.
wolffd@0:
wolffd@0: conjgrad(f, x, options, gradf, p1, p2, ...)
allows
wolffd@0: additional arguments to be passed to f()
and gradf()
.
wolffd@0:
wolffd@0:
The optional parameters have the following interpretations. wolffd@0: wolffd@0:
options(1)
is set to 1 to display error values; also logs error
wolffd@0: values in the return argument errlog
, and the points visited
wolffd@0: in the return argument pointslog
. If options(1)
is set to 0,
wolffd@0: then only warning messages are displayed. If options(1)
is -1,
wolffd@0: then nothing is displayed.
wolffd@0:
wolffd@0:
options(2)
is a measure of the absolute precision required for the value
wolffd@0: of x
at the solution. If the absolute difference between
wolffd@0: the values of x
between two successive steps is less than
wolffd@0: options(2)
, then this condition is satisfied.
wolffd@0:
wolffd@0:
options(3)
is a measure of the precision required of the objective
wolffd@0: function at the solution. If the absolute difference between the
wolffd@0: objective function values between two successive steps is less than
wolffd@0: options(3)
, then this condition is satisfied.
wolffd@0: Both this and the previous condition must be
wolffd@0: satisfied for termination.
wolffd@0:
wolffd@0:
options(9)
is set to 1 to check the user defined gradient function.
wolffd@0:
wolffd@0:
options(10)
returns the total number of function evaluations (including
wolffd@0: those in any line searches).
wolffd@0:
wolffd@0:
options(11)
returns the total number of gradient evaluations.
wolffd@0:
wolffd@0:
options(14)
is the maximum number of iterations; default 100.
wolffd@0:
wolffd@0:
options(15)
is the precision in parameter space of the line search;
wolffd@0: default 1e-4
.
wolffd@0:
wolffd@0:
wolffd@0: wolffd@0: w = quasinew('neterr', w, options, 'netgrad', net, x, t); wolffd@0:wolffd@0: wolffd@0: wolffd@0:
di
that are conjugate: i.e. di*H*d(i-1) = 0
,
wolffd@0: where H
is the Hessian matrix. This means that minimising along
wolffd@0: di
does not undo the effect of minimising along the previous
wolffd@0: direction. The Polak-Ribiere formula is used to calculate new search
wolffd@0: directions. The Hessian is not calculated, so there is only an
wolffd@0: O(W)
storage requirement (where W
is the number of
wolffd@0: parameters). However, relatively accurate line searches must be used
wolffd@0: (default is 1e-04
).
wolffd@0:
wolffd@0: graddesc
, linemin
, minbrack
, quasinew
, scg
Copyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: wolffd@0: wolffd@0: