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