Page 1 of 1

ANN batch training (How to train online)?

PostPosted: Sat Oct 13, 2018 12:39 pm
by Saeed
Hi,

I need to have a batch training with my network. I have searched a lot but, I couldn't find any example for accord.net.
In fact because of memory problem I need to train my network with a batch of input data (backpropagation). I tried it with the routine procedure, which e.g. I implemented two separate loops to see if the network works well! but it trains just for one batch (last trained). See the example below.

Could somebody help how can we train the network in this way, please?
Code: Select all
SigmoidFunction activation = new SigmoidFunction(2);
ActivationNetwork network_1 = new ActivationNetwork(
activation,
5, // neurons in the first layer
5,// neurons in the first layer
2); // neuron in the second layer

LML_teacher = new LevenbergMarquardtLearning(network_1, false);

//------------Batch1------------------------------
while (iterations < max_iteration && (error1 > 0.01f))
{
iterations++;
// run epoch of learning procedure
error1 = LML_teacher.RunEpoch(Tnormalized_input1, Tnormalized_output1);
}
// **It learns well for batch1**

//------------Batch2------------------------------
while (iterations < max_iteration && (error1 > 0.01f))
{
iterations++;
// run epoch of learning procedure
error1 = LML_teacher.RunEpoch(Tnormalized_input2, Tnormalized_output2);
}
// **It learns just batch2 and batch1 is missing**

Re: ANN batch training (How to train online)?

PostPosted: Sat Oct 13, 2018 4:54 pm
by andrew.kirillov
Hello,

This forum is about AForge.NET Framework, not Accord.NET Framework. In AForge.NET batch training is not implemented. If you need to know about Accord.NET, then you need to direct your questions to them.