Daniel@0: Daniel@0: Daniel@0: Daniel@0: Netlab Reference Manual conjgrad Daniel@0: Daniel@0: Daniel@0: Daniel@0:

conjgrad Daniel@0:

Daniel@0:

Daniel@0: Purpose Daniel@0:

Daniel@0: Conjugate gradients optimization. Daniel@0: Daniel@0:

Daniel@0: Description Daniel@0:

Daniel@0: [x, options, flog, pointlog] = conjgrad(f, x, options, gradf) uses a Daniel@0: conjugate gradients Daniel@0: algorithm to find the minimum of the function f(x) whose Daniel@0: gradient is given by gradf(x). Here x is a row vector Daniel@0: and f returns a scalar value. Daniel@0: The point at which f has a local minimum Daniel@0: is returned as x. The function value at that point is returned Daniel@0: in options(8). A log of the function values Daniel@0: after each cycle is (optionally) returned in flog, and a log Daniel@0: of the points visited is (optionally) returned in pointlog. Daniel@0: Daniel@0:

conjgrad(f, x, options, gradf, p1, p2, ...) allows Daniel@0: additional arguments to be passed to f() and gradf(). Daniel@0: Daniel@0:

The optional parameters have the following interpretations. Daniel@0: Daniel@0:

options(1) is set to 1 to display error values; also logs error Daniel@0: values in the return argument errlog, and the points visited Daniel@0: in the return argument pointslog. If options(1) is set to 0, Daniel@0: then only warning messages are displayed. If options(1) is -1, Daniel@0: then nothing is displayed. Daniel@0: Daniel@0:

options(2) is a measure of the absolute precision required for the value Daniel@0: of x at the solution. If the absolute difference between Daniel@0: the values of x between two successive steps is less than Daniel@0: options(2), then this condition is satisfied. Daniel@0: Daniel@0:

options(3) is a measure of the precision required of the objective Daniel@0: function at the solution. If the absolute difference between the Daniel@0: objective function values between two successive steps is less than Daniel@0: options(3), then this condition is satisfied. Daniel@0: Both this and the previous condition must be Daniel@0: satisfied for termination. Daniel@0: Daniel@0:

options(9) is set to 1 to check the user defined gradient function. Daniel@0: Daniel@0:

options(10) returns the total number of function evaluations (including Daniel@0: those in any line searches). Daniel@0: Daniel@0:

options(11) returns the total number of gradient evaluations. Daniel@0: Daniel@0:

options(14) is the maximum number of iterations; default 100. Daniel@0: Daniel@0:

options(15) is the precision in parameter space of the line search; Daniel@0: default 1e-4. Daniel@0: Daniel@0:

Daniel@0: Examples Daniel@0:

Daniel@0: An example of Daniel@0: the use of the additional arguments is the minimization of an error Daniel@0: function for a neural network: Daniel@0:
Daniel@0: 
Daniel@0: w = quasinew('neterr', w, options, 'netgrad', net, x, t);
Daniel@0: 
Daniel@0: Daniel@0: Daniel@0:

Daniel@0: Algorithm Daniel@0:

Daniel@0: Daniel@0: The conjugate gradients algorithm constructs search Daniel@0: directions di that are conjugate: i.e. di*H*d(i-1) = 0, Daniel@0: where H is the Hessian matrix. This means that minimising along Daniel@0: di does not undo the effect of minimising along the previous Daniel@0: direction. The Polak-Ribiere formula is used to calculate new search Daniel@0: directions. The Hessian is not calculated, so there is only an Daniel@0: O(W) storage requirement (where W is the number of Daniel@0: parameters). However, relatively accurate line searches must be used Daniel@0: (default is 1e-04). Daniel@0: Daniel@0:

Daniel@0: See Also Daniel@0:

Daniel@0: graddesc, linemin, minbrack, quasinew, scg
Daniel@0: Pages: Daniel@0: Index Daniel@0:
Daniel@0:

Copyright (c) Ian T Nabney (1996-9) Daniel@0: Daniel@0: Daniel@0: Daniel@0: