wolffd@0: function g = netgrad_weighted(w, net, x, t, eso_w) wolffd@0: %NETGRAD Evaluate network error gradient for generic optimizers wolffd@0: % wolffd@0: % Description wolffd@0: % wolffd@0: % G = NETGRAD(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 gradient of the error wolffd@0: % function evaluated at W. wolffd@0: % wolffd@0: % See also wolffd@0: % MLP, NETERR, NETOPT wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: gradstr = [net.type, 'grad_weighted']; wolffd@0: wolffd@0: net = netunpak(net, w); wolffd@0: wolffd@0: g = feval(gradstr, net, x, t, eso_w);