AForge.NET

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

Kohonen SOM Input data range

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

Kohonen SOM Input data range

Postby thizzleboom » Sun Aug 16, 2009 12:20 am

Hi all! I have a few questions regarding the usage of Kohonen SOM's in Aforge.
1)I have data that I am feeding into a neural network that is normalized from [-1,1] for use with the BipolarSigmoidFunction. I'm trying to process this data using DistanceNetwork and SOMLearning, but I'm not sure if I should renormalize the data back to the range of [0,1] or if I should could leave it as is.

2)It's not exactly clear to me how to use the DistanceNetwork after it has been trained. Do you use the Compute method and find the neuron with the highest output?
thizzleboom
 
Posts: 8
Joined: Sat Aug 15, 2009 10:13 pm

Re: Kohonen SOM Input data range

Postby andrew.kirillov » Mon Aug 17, 2009 11:15 am

Hello,

1) Kohonen SOM has nothing to do with sigmoid functions. You don't need to normalize data at all. Just use original data range.

2) Yes, Compute() and then find the neuron with minimum output, which means min difference between weights and inputs. You can use GetWinner() method for it.
With best regards,
Andrew


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

Re: Kohonen SOM Input data range

Postby thizzleboom » Mon Aug 17, 2009 6:59 pm

Got it. Thanks!
thizzleboom
 
Posts: 8
Joined: Sat Aug 15, 2009 10:13 pm

Re: Kohonen SOM Input data range

Postby chamindasomathilaka » Fri Nov 19, 2010 8:54 am

Hi Andrew,

Thanks for having this wonderful framework for .NET coders like me.

I am working on a project (for Masters research) where I want to feed my own data set to a SOM and then I want to Compute() and GetWinner() to validate the learned network to classify a given sample. I got the 2D Organizing sample modified to get data set to do the learning with a CSV file.
But I am bit doubtful about how to add it to 2D organizing sample and to get it to show the winner on the canvas. Can you please provide me a code sample which I can use to implement similar functionality.

Thanks in advance.
Chaminda Somathilaka
chamindasomathilaka
 
Posts: 5
Joined: Wed Nov 17, 2010 5:31 am

Re: Kohonen SOM Input data range

Postby andrew.kirillov » Fri Nov 19, 2010 9:43 am

Hello,

chamindasomathilaka wrote:Can you please provide me a code sample which I can use to implement similar functionality.

No, since I know nothing about your data. As you may see in original 2D-Organizing sample, the same data there are X/Y coordinates of some random points. So visualizing SOM (and winners) is very simple there - just draw small point with the coordinates provided by the network. But I don't know what are the data in you case.

Anyway, you have sample code, so just see how drawing/visualization is done there and try to extract something useful for your case.
With best regards,
Andrew


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

Re: Kohonen SOM Input data range

Postby chamindasomathilaka » Sun Nov 28, 2010 10:01 am

]my data set is having 78 features, all of them are floating point numbers. What I did was I modified the 2D Organization sample to have 78 feature data set being the input and tried to learn the system with that data set.

// create network
DistanceNetwork network = new DistanceNetwork(this.NumberOfInputs, networkSize * networkSize);

now when I train the network with data set I can see about two clusters visually on the panel. however ideally I should have 5 clusters on this data set.

What I am confused here is if I have done the correct modification to allocate my dataset or not. If this is actually two cluster dataset, then how should I validate it with something else.
Also what I am thinking is if I can highlight the winner on the panel may be I can visually prove the model is correct.

Also is there any dataset that I can use with this to prove the tool is correctly working or any other cross referencing system ?

I have attached the modified code with this ..
SOM.Analyzer.zip
(130.6 KiB) Downloaded 655 times


Thanks,
chamindasomathilaka
 
Posts: 5
Joined: Wed Nov 17, 2010 5:31 am

Re: Kohonen SOM Input data range

Postby andrew.kirillov » Sun Nov 28, 2010 1:55 pm

What about changing initial learning radius and learning rate? These things may affect number of clusters found.
With best regards,
Andrew


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

Re: Kohonen SOM Input data range

Postby chamindasomathilaka » Sun Nov 28, 2010 5:26 pm

I tried few different combinations without any luck.
what confused me a lot is that when I tried Iris data set from UCL, the application still unable to show clear clusters on that data set. ideally it should at least have two clusters.
One thing that I would like to get confirmed from you is that my approach is correct or not. I would be great if you can download my source code and try to run it and see if anything wrong with it.

i will update iris data set I used in testing here
iris.zip
(958 Bytes) Downloaded 590 times
chamindasomathilaka
 
Posts: 5
Joined: Wed Nov 17, 2010 5:31 am

Re: Kohonen SOM Input data range

Postby andrew.kirillov » Sun Nov 28, 2010 7:42 pm

chamindasomathilaka wrote:I would be great if you can download my source code and try to run it and see if anything wrong with it.

Did not install VS.NET 2010 yet.
With best regards,
Andrew


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

Re: Kohonen SOM Input data range

Postby chamindasomathilaka » Mon Nov 29, 2010 9:50 am

SOM.Analyzer.zip
(147.96 KiB) Downloaded 660 times
this version of source code has all three visual studio solutions. Please check this.

Thanks,
Chaminda
chamindasomathilaka
 
Posts: 5
Joined: Wed Nov 17, 2010 5:31 am



Next

Return to Artificial Intelligence