annotate toolboxes/FullBNT-1.0.7/nethelp3.3/scg.htm @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 <html>
wolffd@0 2 <head>
wolffd@0 3 <title>
wolffd@0 4 Netlab Reference Manual scg
wolffd@0 5 </title>
wolffd@0 6 </head>
wolffd@0 7 <body>
wolffd@0 8 <H1> scg
wolffd@0 9 </H1>
wolffd@0 10 <h2>
wolffd@0 11 Purpose
wolffd@0 12 </h2>
wolffd@0 13 Scaled conjugate gradient optimization.
wolffd@0 14
wolffd@0 15 <p><h2>
wolffd@0 16 Description
wolffd@0 17 </h2>
wolffd@0 18 <CODE>[x, options] = scg(f, x, options, gradf)</CODE> uses a scaled conjugate
wolffd@0 19 gradients
wolffd@0 20 algorithm to find a local minimum of the function <CODE>f(x)</CODE> whose
wolffd@0 21 gradient is given by <CODE>gradf(x)</CODE>. Here <CODE>x</CODE> is a row vector
wolffd@0 22 and <CODE>f</CODE> returns a scalar value.
wolffd@0 23 The point at which <CODE>f</CODE> has a local minimum
wolffd@0 24 is returned as <CODE>x</CODE>. The function value at that point is returned
wolffd@0 25 in <CODE>options(8)</CODE>.
wolffd@0 26
wolffd@0 27 <p><CODE>[x, options, flog, pointlog, scalelog] = scg(f, x, options, gradf)</CODE>
wolffd@0 28 also returns (optionally) a log of the function values
wolffd@0 29 after each cycle in <CODE>flog</CODE>, a log
wolffd@0 30 of the points visited in <CODE>pointlog</CODE>, and a log of the scale values
wolffd@0 31 in the algorithm in <CODE>scalelog</CODE>.
wolffd@0 32
wolffd@0 33 <p><CODE>scg(f, x, options, gradf, p1, p2, ...)</CODE> allows
wolffd@0 34 additional arguments to be passed to <CODE>f()</CODE> and <CODE>gradf()</CODE>.
wolffd@0 35
wolffd@0 36 The optional parameters have the following interpretations.
wolffd@0 37
wolffd@0 38 <p><CODE>options(1)</CODE> is set to 1 to display error values; also logs error
wolffd@0 39 values in the return argument <CODE>errlog</CODE>, and the points visited
wolffd@0 40 in the return argument <CODE>pointslog</CODE>. If <CODE>options(1)</CODE> is set to 0,
wolffd@0 41 then only warning messages are displayed. If <CODE>options(1)</CODE> is -1,
wolffd@0 42 then nothing is displayed.
wolffd@0 43
wolffd@0 44 <p><CODE>options(2)</CODE> is a measure of the absolute precision required for the value
wolffd@0 45 of <CODE>x</CODE> at the solution. If the absolute difference between
wolffd@0 46 the values of <CODE>x</CODE> between two successive steps is less than
wolffd@0 47 <CODE>options(2)</CODE>, then this condition is satisfied.
wolffd@0 48
wolffd@0 49 <p><CODE>options(3)</CODE> is a measure of the precision required of the objective
wolffd@0 50 function at the solution. If the absolute difference between the
wolffd@0 51 objective function values between two successive steps is less than
wolffd@0 52 <CODE>options(3)</CODE>, then this condition is satisfied.
wolffd@0 53 Both this and the previous condition must be
wolffd@0 54 satisfied for termination.
wolffd@0 55
wolffd@0 56 <p><CODE>options(9)</CODE> is set to 1 to check the user defined gradient function.
wolffd@0 57
wolffd@0 58 <p><CODE>options(10)</CODE> returns the total number of function evaluations (including
wolffd@0 59 those in any line searches).
wolffd@0 60
wolffd@0 61 <p><CODE>options(11)</CODE> returns the total number of gradient evaluations.
wolffd@0 62
wolffd@0 63 <p><CODE>options(14)</CODE> is the maximum number of iterations; default 100.
wolffd@0 64
wolffd@0 65 <p><h2>
wolffd@0 66 Examples
wolffd@0 67 </h2>
wolffd@0 68 An example of
wolffd@0 69 the use of the additional arguments is the minimization of an error
wolffd@0 70 function for a neural network:
wolffd@0 71 <PRE>
wolffd@0 72
wolffd@0 73 w = scg('neterr', w, options, 'netgrad', net, x, t);
wolffd@0 74 </PRE>
wolffd@0 75
wolffd@0 76
wolffd@0 77 <p><h2>
wolffd@0 78 Algorithm
wolffd@0 79 </h2>
wolffd@0 80 The search direction is re-started after every <CODE>nparams</CODE>
wolffd@0 81 successful weight updates where <CODE>nparams</CODE> is the total number of
wolffd@0 82 parameters in <CODE>x</CODE>. The algorithm is based on that given by Williams
wolffd@0 83 (1991), with a simplified procedure for updating <CODE>lambda</CODE> when
wolffd@0 84 <CODE>rho < 0.25</CODE>.
wolffd@0 85
wolffd@0 86 <p><h2>
wolffd@0 87 See Also
wolffd@0 88 </h2>
wolffd@0 89 <CODE><a href="conjgrad.htm">conjgrad</a></CODE>, <CODE><a href="quasinew.htm">quasinew</a></CODE><hr>
wolffd@0 90 <b>Pages:</b>
wolffd@0 91 <a href="index.htm">Index</a>
wolffd@0 92 <hr>
wolffd@0 93 <p>Copyright (c) Ian T Nabney (1996-9)
wolffd@0 94
wolffd@0 95
wolffd@0 96 </body>
wolffd@0 97 </html>