wolffd@0: function g = netderiv(w, net, x) wolffd@0: %NETDERIV Evaluate derivatives of network outputs by weights generically. wolffd@0: % wolffd@0: % Description wolffd@0: % wolffd@0: % G = NETDERIV(W, NET, X) takes a weight vector W and a network data wolffd@0: % structure NET, together with the matrix X of input vectors, and wolffd@0: % returns the gradient of the outputs with respect to the weights wolffd@0: % evaluated at W. wolffd@0: % wolffd@0: % See also wolffd@0: % NETEVFWD, NETOPT wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: wolffd@0: fstr = [net.type, 'deriv']; wolffd@0: net = netunpak(net, w); wolffd@0: g = feval(fstr, net, x);