wolffd@0: function [e, varargout] = neterr_weighted(w, net, x, t, eso_w) wolffd@0: %NETERR Evaluate network error function for generic optimizers wolffd@0: % wolffd@0: % Description wolffd@0: % wolffd@0: % E = NETERR(W, NET, X, T) takes a weight vector W and a network data wolffd@0: % structure NET, together with the matrix X of input vectors and the wolffd@0: % matrix T of target vectors, and returns the value of the error wolffd@0: % function evaluated at W. wolffd@0: % wolffd@0: % [E, VARARGOUT] = NETERR(W, NET, X, T) also returns any additional wolffd@0: % return values from the error function. wolffd@0: % wolffd@0: % See also wolffd@0: % NETGRAD, NETHESS, NETOPT wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: errstr = [net.type, 'err_weighted']; wolffd@0: net = netunpak(net, w); wolffd@0: wolffd@0: [s{1:nargout}] = feval(errstr, net, x, t, eso_w); wolffd@0: e = s{1}; wolffd@0: if nargout > 1 wolffd@0: for i = 2:nargout wolffd@0: varargout{i-1} = s{i}; wolffd@0: end wolffd@0: end