在 R 编程中,我试图了解如何使用 nnet 让用户指定初始权重而不是默认值来运行神经网络算法? R 文档提到了以下参数。有如何使用权重的示例吗?
nnet(formula, data, weights, ...,
subset, na.action, contrasts = NULL)
最佳答案
自定义权重应采用以下形式:
weights <- c(
BH1, I1H1, I2H1, .., InH1,
BH2, I1H2, I2H2, .., InH2,
...
BHn, I1Hn, I2Hn, .., InHn,
BO,
I1Out, .., InOut)
即
c(
weights from bias & inputs to 1st hidden unit,
from bias & inputs to second hidden unit H2,
from bias & inputs to last hidden unit Hn,
biast of output unit,
skip layer weights ( if any)
)
问候
附注 请记住将与单位相关的所有权重的标准差保持在 1.0 以下。 否则你的单位很快就会饱和。
关于r - 在 R 编程神经网络中为 nnet 指定 "initial weights",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13773275/