comparison toolboxes/FullBNT-1.0.7/netlab3.3/mlppak.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function w = mlppak(net)
2 %MLPPAK Combines weights and biases into one weights vector.
3 %
4 % Description
5 % W = MLPPAK(NET) takes a network data structure NET and combines the
6 % component weight matrices bias vectors into a single row vector W.
7 % The facility to switch between these two representations for the
8 % network parameters is useful, for example, in training a network by
9 % error function minimization, since a single vector of parameters can
10 % be handled by general-purpose optimization routines.
11 %
12 % The ordering of the paramters in W is defined by
13 % w = [net.w1(:)', net.b1, net.w2(:)', net.b2];
14 % where W1 is the first-layer weight matrix, B1 is the first-layer
15 % bias vector, W2 is the second-layer weight matrix, and B2 is the
16 % second-layer bias vector.
17 %
18 % See also
19 % MLP, MLPUNPAK, MLPFWD, MLPERR, MLPBKP, MLPGRAD
20 %
21
22 % Copyright (c) Ian T Nabney (1996-2001)
23
24 % Check arguments for consistency
25 errstring = consist(net, 'mlp');
26 if ~isempty(errstring);
27 error(errstring);
28 end
29
30 w = [net.w1(:)', net.b1, net.w2(:)', net.b2];
31