Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/netlab3.3/mdnunpak.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 net = mdnunpak(net, w) |
wolffd@0 | 2 %MDNUNPAK Separates weights vector into weight and bias matrices. |
wolffd@0 | 3 % |
wolffd@0 | 4 % Description |
wolffd@0 | 5 % NET = MDNUNPAK(NET, W) takes an mdn network data structure NET and a |
wolffd@0 | 6 % weight vector W, and returns a network data structure identical to |
wolffd@0 | 7 % the input network, except that the weights in the MLP sub-structure |
wolffd@0 | 8 % are set to the corresponding elements of W. |
wolffd@0 | 9 % |
wolffd@0 | 10 % See also |
wolffd@0 | 11 % MDN, MDNPAK, MDNFWD, MDNERR, MDNGRAD |
wolffd@0 | 12 % |
wolffd@0 | 13 |
wolffd@0 | 14 % Copyright (c) Ian T Nabney (1996-2001) |
wolffd@0 | 15 % David J Evans (1998) |
wolffd@0 | 16 |
wolffd@0 | 17 errstring = consist(net, 'mdn'); |
wolffd@0 | 18 if ~errstring |
wolffd@0 | 19 error(errstring); |
wolffd@0 | 20 end |
wolffd@0 | 21 if net.nwts ~= length(w) |
wolffd@0 | 22 error('Invalid weight vector length') |
wolffd@0 | 23 end |
wolffd@0 | 24 |
wolffd@0 | 25 net.mlp = mlpunpak(net.mlp, w); |