我正在使用创建一个简单的多层前馈神经网络锻造网 http://www.aforgenet.com/framework/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 http://www.obitko.com/tutorials/neural-network-prediction/training-set.html)作为时间序列的输入,我的输入和
预期输出数组看起来像这样
//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 时,神经网络无法生成 26!
我的问题:如何训练我的网络接受这种未遇到的输入,以产生学习过程中训练集中发现的正确序列模式?