annotate toolboxes/FullBNT-1.0.7/nethelp3.3/netopt.htm @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 <html>
Daniel@0 2 <head>
Daniel@0 3 <title>
Daniel@0 4 Netlab Reference Manual netopt
Daniel@0 5 </title>
Daniel@0 6 </head>
Daniel@0 7 <body>
Daniel@0 8 <H1> netopt
Daniel@0 9 </H1>
Daniel@0 10 <h2>
Daniel@0 11 Purpose
Daniel@0 12 </h2>
Daniel@0 13 Optimize the weights in a network model.
Daniel@0 14
Daniel@0 15 <p><h2>
Daniel@0 16 Synopsis
Daniel@0 17 </h2>
Daniel@0 18 <PRE>
Daniel@0 19 [net, options] = netopt(net, options, x, t, alg)
Daniel@0 20 [net, options, varargout] = netopt(net, options, x, t, alg)
Daniel@0 21 </PRE>
Daniel@0 22
Daniel@0 23
Daniel@0 24 <p><h2>
Daniel@0 25 Description
Daniel@0 26 </h2>
Daniel@0 27
Daniel@0 28 <p><CODE>netopt</CODE> is a helper function which facilitates the training of
Daniel@0 29 networks using the general purpose optimizers as well as sampling from the
Daniel@0 30 posterior distribution of parameters using general purpose Markov chain
Daniel@0 31 Monte Carlo sampling algorithms. It can be used with any function that
Daniel@0 32 searches in parameter space using error and gradient functions.
Daniel@0 33
Daniel@0 34 <p><CODE>[net, options] = netopt(net, options, x, t, alg)</CODE> takes a network
Daniel@0 35 data structure <CODE>net</CODE>, together with a vector <CODE>options</CODE> of
Daniel@0 36 parameters governing the behaviour of the optimization algorithm, a
Daniel@0 37 matrix <CODE>x</CODE> of input vectors and a matrix <CODE>t</CODE> of target
Daniel@0 38 vectors, and returns the trained network as well as an updated
Daniel@0 39 <CODE>options</CODE> vector. The string <CODE>alg</CODE> determines which optimization
Daniel@0 40 algorithm (<CODE>conjgrad</CODE>, <CODE>quasinew</CODE>, <CODE>scg</CODE>, etc.) or Monte
Daniel@0 41 Carlo algorithm (such as <CODE>hmc</CODE>) will be used.
Daniel@0 42
Daniel@0 43 <p><CODE>[net, options, varargout] = netopt(net, options, x, t, alg)</CODE>
Daniel@0 44 also returns any additional return values from the optimisation algorithm.
Daniel@0 45
Daniel@0 46 <p><h2>
Daniel@0 47 Examples
Daniel@0 48 </h2>
Daniel@0 49 Suppose we create a 4-input, 3 hidden unit, 2-output feed-forward
Daniel@0 50 network using <CODE>net = mlp(4, 3, 2, 'linear')</CODE>. We can then train
Daniel@0 51 the network with the scaled conjugate gradient algorithm by using
Daniel@0 52 <CODE>net = netopt(net, options, x, t, 'scg')</CODE> where <CODE>x</CODE> and
Daniel@0 53 <CODE>t</CODE> are the input and target data matrices respectively, and the
Daniel@0 54 options vector is set appropriately for <CODE>scg</CODE>.
Daniel@0 55
Daniel@0 56 <p>If we also wish to plot the learning curve, we can use the additional
Daniel@0 57 return value <CODE>errlog</CODE> given by <CODE>scg</CODE>:
Daniel@0 58 <PRE>
Daniel@0 59
Daniel@0 60 [net, options, errlog] = netopt(net, options, x, t, 'scg');
Daniel@0 61 </PRE>
Daniel@0 62
Daniel@0 63
Daniel@0 64 <p><h2>
Daniel@0 65 See Also
Daniel@0 66 </h2>
Daniel@0 67 <CODE><a href="netgrad.htm">netgrad</a></CODE>, <CODE><a href="bfgs.htm">bfgs</a></CODE>, <CODE><a href="conjgrad.htm">conjgrad</a></CODE>, <CODE><a href="graddesc.htm">graddesc</a></CODE>, <CODE><a href="hmc.htm">hmc</a></CODE>, <CODE><a href="scg.htm">scg</a></CODE><hr>
Daniel@0 68 <b>Pages:</b>
Daniel@0 69 <a href="index.htm">Index</a>
Daniel@0 70 <hr>
Daniel@0 71 <p>Copyright (c) Ian T Nabney (1996-9)
Daniel@0 72
Daniel@0 73
Daniel@0 74 </body>
Daniel@0 75 </html>