【发布时间】:2016-02-03 08:52:36
【问题描述】:
我正在使用AForge.net NN 库创建一个简单的多层前馈神经网络。我的 NN 是一个 3 层激活网络,使用反向传播学习算法通过监督学习方法进行训练。
以下是我的初始设置:
//learning rate
learningRate=0.1;
//momentum value
momentum=0;
//alpha value for bipolar sigmoid activation function
sigmoidAlphaValue=2.0;
//number of inputs to network
inputSize=5;
//number of outputs from network
predictionSize=1;
//iterations
iterations=10000;
// create multi-layer neural network
ActivationNetwork network = new ActivationNetwork(new BipolarSigmoidFunction
(sigmoidAlphaValue), 5, 5 + 1, 3, 1);
//5 inputs
//6 neurons in input layer
//3 neurons in hidden layer
//1 neuron in output layer
// create teacher
BackPropagationLearning teacher = new BackPropagationLearning(network);
// set learning rate and momentum
teacher.LearningRate = learningRate;
teacher.Momentum = momentum;
现在我有一些看起来像这样的输入系列, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
使用窗口滑动方法(如here所述)作为时间序列的输入,我的输入和
预期的输出数组看起来像这样
//Iteration #1
double input[][] = new input[0][5] {1,2,3,4,5};
double output[][] = new output[0][0] {6};
//Iteration #2
double input[][] = new input[1][5] {2,3,4,5,6};
double output[][] = new output[1][0] {7};
//Iteration #3
double input[][] = new input[2][5] {3,4,5,6,7};
double output[][] = new output[2][0] {8};
.
.
.
//Iteration #n
double input[][] = new input[n][5] {15,16,17,18,19};
double output[][] = new output[n][0] {20};
在这样使用 10k 次迭代之后
teacher.RunEpoch(input, output);
我的网络已针对给定的训练集成功训练。所以现在,如果我使用输入作为 4、5、6、7、8 进行计算,网络会成功给出 9 作为答案!
但是,当输入为 21、22、23、24、25 时,NN 无法生成 26!
我的问题: 我如何训练我的网络接受这种前所未有的输入,以产生正确的序列模式,就像在学习期间在训练集中找到的那样?
【问题讨论】:
-
您的网络似乎过拟合了,也就是说,除了重现数据之外,它并没有真正学到任何东西。尝试减少迭代并尝试使用参数。另外,输入层中额外的 +1 单元是什么?
-
我假设添加一个额外的输入神经元意味着它是一个偏置神经元,我的错。
-
另外,把它放在上下文中。时间序列预测通常使用 RNN 而不是 MLP 完成。但是,如果输入是静态的,那么它应该可以与 MLP 一起使用。
标签: machine-learning neural-network time-series aforge supervised-learning