如何使用neuralnet软件包初始化权重?
我在R中使用了neuralnet包,但是当我想为我的网络初始化一定数量的初始权重时,我遇到了一个问题。我试着根据我从生成的默认随机权重得到的结果来做,但一点运气都没有 这是我应该放置初始权重的部分:如何使用neuralnet软件包初始化权重?,r,R,我在R中使用了neuralnet包,但是当我想为我的网络初始化一定数量的初始权重时,我遇到了一个问题。我试着根据我从生成的默认随机权重得到的结果来做,但一点运气都没有 这是我应该放置初始权重的部分: weigths<-c(-0.3,0.2, 0.2,0.05, 0,2,-0.1, -0.1,0.2,0.2) net=neuralnet(to~x1+x2,tdata,hidden=2,threshold=0.01,constant.weights=weights)
weigths<-c(-0.3,0.2,
0.2,0.05,
0,2,-0.1,
-0.1,0.2,0.2)
net=neuralnet(to~x1+x2,tdata,hidden=2,threshold=0.01,constant.weights=weights)
但当我应用它时,我得到了一个错误:
Error in constant.weights != 0
有什么帮助吗
谢谢您正在寻找初始化自定义权重的
startweights
参数。这在文档中:
help(neuralnet)
startweights:
a vector containing starting values for the weights.
The weights will not be randomly initialized.
constant.weights
用于指定固定权重,这些权重本应通过exclude
agrument排除。您正在寻找startweights
参数来初始化自定义权重。这在文档中:
help(neuralnet)
startweights:
a vector containing starting values for the weights.
The weights will not be randomly initialized.
constant.weights
用于指定固定权重,这些权重本应通过exclude
agrument排除。您正在寻找startweights
参数来初始化自定义权重。这在文档中:
help(neuralnet)
startweights:
a vector containing starting values for the weights.
The weights will not be randomly initialized.
constant.weights
用于指定固定权重,这些权重本应通过exclude
agrument排除。您正在寻找startweights
参数来初始化自定义权重。这在文档中:
help(neuralnet)
startweights:
a vector containing starting values for the weights.
The weights will not be randomly initialized.
constant.weights
用于指定固定权重,您可以使用exclude
agrument排除这些权重