joi, 5 mai 2016

Neural Nets

This is a Machine Learning subject.
Artificial intelligence was one of my interests in college.   My major in college was Control Engineering, with a specialty in artificial intelligence.  I have a lot of interest in this area so I decided to do some reading in my 10% time to see how much farther were the field advances as opposed to what they were when I finished my college in 1999 (last century I know ;).
When I coded my first neural net in c in my college years, I had to write it from scratch (based on neural net theory at the time) then to teach it manually with some data.  It was about a feed forward neural net for number recognition (1 through ten).  So I started from the available neural net theory existing back then and I coded one from scratch.  Things like input data sets normalization, bias neurons and best number of layers were unknown to me at that point.

Fast forward to present, after searching and documenting myself I found out that there are a few libraries of neural nets around - some of them open source.  I decided to try Encog and see what's up with it.  
The main thing is that Encog provides neural nets out of the box, with support for neural net training and pattern recognition.  
It provides a programmatically usable API for building neural net features into the programs.  Encog provides support for data training sets normalization, neural net training and result verification.      
Coding a neural net is nowadays a breeze, its just a matter of writing a few lines of code.  For instance the following code snippet builds a XOR neural net, trains it and checks the results:
image
  
image












 The neural net is built the following way.  It is configured with 3 layers, input, hidden and the output layer:
image










The code snippet below shows how the training is being done (until an error rate lower than 1% is being reached):

image











The the results are being verified:

image


Encog also provides support for creating, configuring, training and checking neural net results in a non-programmatic way, by providing Encog workbench functionality.  Using an UI interface, one can configure, train and verify results for various types of neural nets.  Furthermore, configurations and training results could be saved and reused later.
The below pictures show neural net structure, training results and result verification:

image

image














image








    
The conclusion is that now is much easier to build and train your own neural nets - it's simple to include them into your program/products.  The theory behind the nets has improved significantly as well.  It provides guidance on how to build a neural net, how many layers should it have, how many neurons could be used, how the bias neurons should be configured, as well as input data sets normalizing and a lot more.

Niciun comentariu:

Trimiteți un comentariu