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