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