當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R nnetHess 評估神經網絡的 Hessian 矩陣

R語言 nnetHess 位於 nnet 包(package)。

說明

評估指定神經網絡的 Hessian(二階導數矩陣)。通常通過參數 Hess=TRUEnnet 或通過 vcov.multinom 調用。

用法

nnetHess(net, x, y, weights)

參數

net

nnet 返回的類 nnet 的對象。

x

訓練數據。

y

訓練數據的類。

weights

nnet 擬合中使用的(案例)權重。

根據網絡中存儲的權重計算的 Hessian 矩陣的對稱方陣。

例子

# 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

參考

Ripley, B. D. (1996) Pattern Recognition and Neural Networks. Cambridge.

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

也可以看看

nnet , predict.nnet

相關用法


注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Evaluates Hessian for a Neural Network。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。