annotate toolboxes/FullBNT-1.0.7/netlab3.3/mlppak.m @ 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 function w = mlppak(net)
Daniel@0 2 %MLPPAK Combines weights and biases into one weights vector.
Daniel@0 3 %
Daniel@0 4 % Description
Daniel@0 5 % W = MLPPAK(NET) takes a network data structure NET and combines the
Daniel@0 6 % component weight matrices bias vectors into a single row vector W.
Daniel@0 7 % The facility to switch between these two representations for the
Daniel@0 8 % network parameters is useful, for example, in training a network by
Daniel@0 9 % error function minimization, since a single vector of parameters can
Daniel@0 10 % be handled by general-purpose optimization routines.
Daniel@0 11 %
Daniel@0 12 % The ordering of the paramters in W is defined by
Daniel@0 13 % w = [net.w1(:)', net.b1, net.w2(:)', net.b2];
Daniel@0 14 % where W1 is the first-layer weight matrix, B1 is the first-layer
Daniel@0 15 % bias vector, W2 is the second-layer weight matrix, and B2 is the
Daniel@0 16 % second-layer bias vector.
Daniel@0 17 %
Daniel@0 18 % See also
Daniel@0 19 % MLP, MLPUNPAK, MLPFWD, MLPERR, MLPBKP, MLPGRAD
Daniel@0 20 %
Daniel@0 21
Daniel@0 22 % Copyright (c) Ian T Nabney (1996-2001)
Daniel@0 23
Daniel@0 24 % Check arguments for consistency
Daniel@0 25 errstring = consist(net, 'mlp');
Daniel@0 26 if ~isempty(errstring);
Daniel@0 27 error(errstring);
Daniel@0 28 end
Daniel@0 29
Daniel@0 30 w = [net.w1(:)', net.b1, net.w2(:)', net.b2];
Daniel@0 31