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