【发布时间】:2013-05-13 22:07:19
【问题描述】:
我正在使用 neuralnet 包编写一个神经网络,用于预测 R 中时间序列 x + sin(x^2) 中的元素。这就是训练数据的生成方式,假设窗口有 4 个元素,并且最后一个是必须预测的:
nntr0 <- ((1:25) + sin((1:25)^2))
nntr1 <- ((2:26) + sin((2:26)^2))
nntr2 <- ((3:27) + sin((3:27)^2))
nntr3 <- ((4:28) + sin((4:28)^2))
nntr4 <- ((5:29) + sin((5:29)^2))
然后,我把这些变成一个data.frame:
nntr <- data.frame(nntr0, nntr1, nntr2, nntr3, nntr4)
然后,我继续训练神经网络:
net.sinp <- neuralnet(nntr4 ~ nntr0 + nntr1 + nntr2 + nntr3, data=nntr, hidden=10, threshold=0.04, act.fct="tanh", linear.output=TRUE, stepmax=100000)
过了一会儿,它给了我信息
Warning message:
algorithm did not converge in 1 of 1 repetition(s) within the stepmax
Call: neuralnet(formula = nntr4 ~ nntr0 + nntr1 + nntr2 + nntr3, data = nntr, hidden = 10, threshold = 0.04, stepmax = 100000, act.fct = "tanh", linear.output = TRUE)
谁能帮我弄清楚为什么它没有收敛?非常感谢
【问题讨论】:
标签: r neural-network time-series convergence