简体   繁体   English

R 中插入符号中神经网络 (nnet) 的超参数调整

[英]Hyperparameter tuning for neural net (nnet) in caret in R

I am constructing a neural net model in R using caret package and my code is as follows:我正在使用插入符号 package 在 R 中构建神经网络 model ,我的代码如下:

model <- train(RS_LAI~S2REP_LF+PSRI_ES+IRECI+NDVIRE+B11_ES+B7+TCARI_LF+MCARI+WDRVI
               , data = Data, 
               method = "nnet", trControl = controlparameters,
               linout = TRUE)

At the end when the model runs the result I get is the final value of size and decay.最后,当 model 运行时,我得到的结果是大小和衰减的最终值。 Here I suppose, size is the number of hidden layers, but I am confused what is the number of nodes its using in each layer?在这里我想,大小是隐藏层的数量,但我很困惑它在每一层中使用的节点数量是多少? How can I get that?我怎么能得到那个? I think the number of nodes is also an important parameter to tune, but caret doesn't give that option.我认为节点的数量也是一个重要的调整参数,但插入符号没有给出这个选项。

You are using nnet , if you read the help page :如果您阅读帮助页面,您正在使用nnet

Fit single-hidden-layer neural network, possibly with skip-layer connections.拟合单隐藏层神经网络,可能带有跳层连接。

So it is 1 layer and the size parameter is the number of nodes or units, as you can see from the same help page:所以它是 1 层,size 参数是节点或单元的数量,您可以从同一个帮助页面中看到:

size: number of units in the hidden layer. size:隐藏层中的单元数。 Can be zero if there are skip-layer units.如果存在跳层单元,则可以为零。

You can try to use neuralnet , it specifies up to 3 layers and your hyperparameters would be the number of nodes in each layer.您可以尝试使用neuralnet网络,它最多指定 3 层,您的超参数将是每层中的节点数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM