AForge.NET

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

RunEpoch return

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

RunEpoch return

Postby riba_net » Thu May 12, 2011 9:12 pm

Hi guys!

I'm having trouble to use AForge.NET neuro..

Im trying to do something like this:

input: an array of array with 400 positions each one - it means any single pixel of an image.. example {0,0,0,0,0,0,1....0} until 400

output: an array with 26 positions, which the one who has "1"value is the index of the alphabet (letter A for example will be something like this: {1,0,0,0,0...0} until position 26 (0-25)

And then:

Code: Select all
m_net = new ActivationNetwork(new SigmoidFunction(), 400, Convert.ToInt32 (Math.Round(Math.Sqrt(400* 26))), 26);


400 = number of input values
26 = number of output values

and then i have the array of array with the type specified above..

When I use the runepoch method:
Code: Select all
BackPropagationLearning teacher = new BackPropagationLearning(m_net);
m_errorCode = teacher.RunEpoch(input, output);


But the error code is always the same, what am i doing wrong?

Thanks!
riba_net
 
Posts: 13
Joined: Wed May 11, 2011 8:58 pm

Re: RunEpoch return

Postby andrew.kirillov » Fri May 13, 2011 9:30 am

Hello,

riba_net wrote:But the error code is always the same, what am i doing wrong?

How many iterations did you run?

I would try using BipolarSigmoidFunction and using -1 and 1 values, instead of 0 and 1. This should improve speed of learning.

You may also need to experiment with Alpha property of sigmoid function.
With best regards,
Andrew


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

Re: RunEpoch return

Postby riba_net » Fri May 13, 2011 2:08 pm

Hello andrew!

Thanks for your answer!

I will try something like this and see what happen! ;)

Im runing with 1000 iterations!
riba_net
 
Posts: 13
Joined: Wed May 11, 2011 8:58 pm

Re: RunEpoch return

Postby riba_net » Fri May 13, 2011 2:42 pm

I used the BipolarSigmoidFunction and changed the input and output numbers for -1 and 1.. and didnt work correctly =/

The error percentage is always the same... it doenst change =/ i am doing everything right!

Code: Select all
m_net = new ActivationNetwork(new BipolarSigmoidFunction(2), 400, Convert.ToInt32 (Math.Round(Math.Sqrt(400* 26))), 26);


My arrays are working perfectly... the runepoch number continue to return the same error

Code: Select all
m_errorCode = teacher.RunEpoch(input, output);
riba_net
 
Posts: 13
Joined: Wed May 11, 2011 8:58 pm

Re: RunEpoch return

Postby danielholley1982 » Tue Jun 07, 2016 3:43 pm

I know this post is over 5 years old, but in case someone hits this same issue, the problem is the size of the network. If you step your network down in size you will be able to get results at some point. Also the ResilientBackpropagationLearning method can handle larger networks. This seems to be some sort of overflow error. I will try to track it down and offer a patch at some point, but I am currently in the middle of a project. Hope this helps someone.
danielholley1982
 
Posts: 1
Joined: Tue Jun 07, 2016 3:39 pm

Re: RunEpoch return

Postby mohit_aren » Thu Sep 14, 2017 10:52 am

I also tried to recognize 26 English alphabets from image by passing arrays of size 166 and error is same for all type of Learning classes: 16.3813 and it is same after every epoch.

I have used BipolarSigmoidFunction and values between -1 and 1 and output as 1 dim.

Please help me resolve the same.
mohit_aren
 
Posts: 2
Joined: Thu Sep 14, 2017 10:49 am

Re: RunEpoch return

Postby mohit_aren » Thu Sep 14, 2017 10:53 am

I tried using ResilientBackpropagationLearning but no change in error still.
mohit_aren
 
Posts: 2
Joined: Thu Sep 14, 2017 10:49 am




Return to AForge.NET Framework

cron