wolffd@0: function net = mdnunpak(net, w) wolffd@0: %MDNUNPAK Separates weights vector into weight and bias matrices. wolffd@0: % wolffd@0: % Description wolffd@0: % NET = MDNUNPAK(NET, W) takes an mdn network data structure NET and a wolffd@0: % weight vector W, and returns a network data structure identical to wolffd@0: % the input network, except that the weights in the MLP sub-structure wolffd@0: % are set to the corresponding elements of W. wolffd@0: % wolffd@0: % See also wolffd@0: % MDN, MDNPAK, MDNFWD, MDNERR, MDNGRAD wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: % David J Evans (1998) wolffd@0: wolffd@0: errstring = consist(net, 'mdn'); wolffd@0: if ~errstring wolffd@0: error(errstring); wolffd@0: end wolffd@0: if net.nwts ~= length(w) wolffd@0: error('Invalid weight vector length') wolffd@0: end wolffd@0: wolffd@0: net.mlp = mlpunpak(net.mlp, w);