EVOLUTION-MANAGER
Edit File: nnet.Hess.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Evaluates Hessian for a Neural Network</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for nnetHess {nnet}"><tr><td>nnetHess {nnet}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Evaluates Hessian for a Neural Network </h2> <h3>Description</h3> <p>Evaluates the Hessian (matrix of second derivatives) of the specified neural network. Normally called via argument <code>Hess=TRUE</code> to <code>nnet</code> or via <code>vcov.multinom</code>. </p> <h3>Usage</h3> <pre> nnetHess(net, x, y, weights) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>net</code></td> <td> <p>object of class <code>nnet</code> as returned by <code>nnet</code>. </p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>training data. </p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>classes for training data. </p> </td></tr> <tr valign="top"><td><code>weights</code></td> <td> <p>the (case) weights used in the <code>nnet</code> fit. </p> </td></tr></table> <h3>Value</h3> <p>square symmetric matrix of the Hessian evaluated at the weights stored in the net. </p> <h3>References</h3> <p>Ripley, B. D. (1996) <em>Pattern Recognition and Neural Networks.</em> Cambridge. </p> <p>Venables, W. N. and Ripley, B. D. (2002) <em>Modern Applied Statistics with S.</em> Fourth edition. Springer. </p> <h3>See Also</h3> <p><code><a href="nnet.html">nnet</a></code>, <code><a href="predict.nnet.html">predict.nnet</a></code> </p> <h3>Examples</h3> <pre> # use half the iris data ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) targets <- matrix(c(rep(c(1,0,0),50), rep(c(0,1,0),50), rep(c(0,0,1),50)), 150, 3, byrow=TRUE) samp <- c(sample(1:50,25), sample(51:100,25), sample(101:150,25)) ir1 <- nnet(ir[samp,], targets[samp,], size=2, rang=0.1, decay=5e-4, maxit=200) eigen(nnetHess(ir1, ir[samp,], targets[samp,]), TRUE)$values </pre> <hr /><div style="text-align: center;">[Package <em>nnet</em> version 7.3-12 <a href="00Index.html">Index</a>]</div> </body></html>