AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

training network with one by one input

The forum is to discuss topics from different artificial intelligence areas, like neural networks, genetic algorithms, machine learning, etc.

Re: training network with one by one input

Postby andrew.kirillov » Fri Jun 17, 2011 9:20 am

sleepy_hollow wrote:i expect that error would decreased until reach my error limitation and be converged

Why do think it will reach your error limit? Should it? Your error level may be set wrong, for example. Also you may have "confusing" data set for neural network - one sample may tell go this way, another may tell got that way. So neural network may not know which way to go.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3446
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: training network with one by one input

Postby sleepy_hollow » Tue Jun 21, 2011 3:39 am

let me explained my trouble more detail

first there are 36 character i want to recognize, 0 to 9 and A to Z, which 8x10 pixel image
so there are 36 output patterns in my network

from this link (http://www.codeproject.com/KB/cs/neural ... k_ocr.aspx)
all image converted to vector image as input patterns and insert to some variable that would be input for neural network
so do mine

ex:
input patterns are "0", so the output pattern will be {0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5,.... -0.5,}
when it changes to "1", so the output pattern will be { -0.5, 0.5, -0.5, -0.5, -0.5, -0.5,.... -0.5,}

so, i use looping to insert one by one the vector images (input patterns) to that variable, and insert output patterns one by one to desired output variable. start with 0 index to 35, when index is 0, the output and input patterns are 0 too.
for error and learning rate value are determined by user and i add momentum value 0.5f in my neural network
sleepy_hollow
 
Posts: 23
Joined: Fri Jan 21, 2011 12:40 pm
Location: indonesia

Re: training network with one by one input

Postby andrew.kirillov » Tue Jun 21, 2011 8:41 am

sleepy_hollow wrote:so, i use looping to insert one by one the vector images (input patterns) to that variable, and insert output patterns one by one to desired output variable. start with 0 index to 35, when index is 0, the output and input patterns are 0 too.
for error and learning rate value are determined by user and i add momentum value 0.5f in my neural network

So? The question remains - why do you think the network will converge to your error limit? What if you set it too small?

Anyway, there is another method to check if the network produces good results or not. You need to have not only training set, but also a test set. Once your network is trained, you just try recognize all characters from the training set. If network recognizes them all, then it works fine.

Be careful with training network to a very-very low error level over the training set. If you go through ANN literature, you will find such thing line "overfitting". Read about it! It can be quite dangerous for many application (actually it results in a bad network).
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3446
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: training network with one by one input

Postby sleepy_hollow » Thu Jun 23, 2011 2:24 pm

it is may be out of topic, but i have another guess beside on your post
may be i set the input for training are wrong

so if, i have 36 output patterns and 10 variants for each patterns, how do i insert each patterns into input and output for training
and how to convert a binary image (8x10 pixel) to vector (in float)

could you write the source here?
i want to see is it mine are wrong or not
sleepy_hollow
 
Posts: 23
Joined: Fri Jan 21, 2011 12:40 pm
Location: indonesia

Re: training network with one by one input

Postby felipermn » Tue Oct 04, 2011 5:29 am

Andrew, thank you so much for this framework!

to train a network with more then one "set"of characters this is correct?

Code: Select all
BackPropagationLearning teacher = new BackPropagationLearning(network);
(inside a "while)...
teacher.RunEpoch(mInputsList1, outputs);
teacher.RunEpoch(mInputsList2, outputs);
teacher.RunEpoch(mInputsList3, outputs);
teacher.RunEpoch(mInputsList4, outputs);


i have more then 700 letters .. i`m gonna organize them into alphabets and train one by one.. thats how it must be trained??
felipermn
 
Posts: 4
Joined: Tue Oct 04, 2011 5:19 am

Re: training network with one by one input

Postby felipermn » Tue Oct 04, 2011 6:24 am

aw

and there is no way to pass an alphabet with lots of examples of each character as input?
felipermn
 
Posts: 4
Joined: Tue Oct 04, 2011 5:19 am

Re: training network with one by one input

Postby andrew.kirillov » Tue Oct 04, 2011 11:49 am

I hope this article should answer your questions. It was written a while ago, but the ANN training idea is the same.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3446
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: training network with one by one input

Postby felipermn » Tue Oct 04, 2011 1:59 pm

I read it.. but it do not explain how to use more then one example of each letter :(
felipermn
 
Posts: 4
Joined: Tue Oct 04, 2011 5:19 am

Re: training network with one by one input

Postby andrew.kirillov » Tue Oct 04, 2011 2:10 pm

Did you see the sample code/application? Did you see it can use multiple fonts, which in the end gives you multiple version of "A", "B", "C" .... ?
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3446
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: training network with one by one input

Postby felipermn » Tue Oct 04, 2011 4:08 pm

of course
i didn't realized that this is what I need haha

thank you so much!!

annd
there is not any donation button to the project?? i would be happy to donate!!!!
felipermn
 
Posts: 4
Joined: Tue Oct 04, 2011 5:19 am



PreviousNext

Return to Artificial Intelligence