Free website sponsorship

Recent Forum Topics

View Discussion beeen a while

since i been oon here :( - summer break = me away from computer.... - how was everyones summer..... - ....any1 have ideas for a csharp project

View Discussion How to setup php so I can use mail() function?

You can set it up in php.ini. http://www.w3schools.com/PHP/php_ref_mail.asp has information on the configuration options required.

View Discussion Creating Identical Tables: HTML and CSS Article

http://programming-designs.com/page/editorials/item/6 - It was under the articles/editorials section of the main site, not the most logical place but PD only had one html tut...

View Discussion LISP

Lisp is cool in a few ways, but the one that strikes most people is that everything is a list. Hence, it is a pretty good list processor. When the first element of a list is not escaped (quoted - described below), th...

View Discussion Review Script: New Job Board Software

We are happy to announce the release of [url=http://www.smartjobboard.com]SmartJobBoard[/url] job board software. [url=http://www.smartjobboard.com]SmartJobBoard[/url] i...


Neural Networks: Understanding Using Visual Basic

Neural Networks as a subject was the most difficult one to learn when I started taking interest in AI. Although, Internet was full of NN tutorials but they all seemed cryptic and too much mathematical. Anything which was available was hard to digest for a beginner in this field. I swept through tons of code and tutorials just to understand what the hell ,much hyped, NNs were. Then, one fine day, Eureka! I finally understood them and their practical applications. I immediately decided to write code in Visual Basic(my fav lang). After an hour of writing code and few more for tweaking it, I finally produced something which I had only dreamt of. It was one of the the best moments of my life.

The real thing: There isn't a single NN tutorial available for Visual Basic Programmers. That is why I decided to write this tutorial.

Introduction to Neural Networks

Neural Network or more appropriately Artificial Neural Network is basically a mathematical model of what goes in our mind(or brain). The brain of all the advanced living creatures consists of neurons, a basic cell, which when interconnected produces what we call Neural Network. The sole purpose of a Neuron is to receive electrical signals, accumulate them and see further if they are strong enough to pass forward.

So simple in its basic functionality but the interconnections of these produces beings(me, u and others) capable of writing about them. phew! The real thing lies not in neurons but the complex pattern in which they are interconnected. NNs are just like a game of chess, easy to learn but hard to master. As the moves of chess are simple, yet the succession of moves is what makes the game complex and fun to play. Imagine, a chess game in which you are allowed only one single move. Would that game be fun to play?

In the same way, a single neuron is useless. Well, practically useless. It is the complex connection between them and values attached with them(explained later) which makes brains capable of thinking and having a sense of consciousness(much debated).

Basic Workings

As explained earlier, a neuron is basically a cell which accumulates electrical signals with different strengths. What it does more is that it compares the accumulated signal with one predefined value unique to every neuron. This value is called bias. Well, now I think is time to explain with an image. So here is it:

Neuron

The circles in the image represents neurons. This network or more appropriately this network topology is called feed-forward multi layered neural network. It is the most basic and most widely used network. I will be explaining this network only.

The network is called multi layered because it consists of more than two layers. The neurons are arranged in a number of layers, generally three. They are input, hidden/middle and output layers. The names signify the function of the layer.

This network is feed-forward, means the values are propagated in one direction only. There are many other topologies in which values can be looped or move in both forward and backward direction. But, this network allows the movement of values only from input layer to output layer. The functions of various layers are explained below:

So now lets get to the code and define the basic elements we'll need in NNs.



The code above is pretty self explanatory. And for the things you haven't understood, don't worry that belongs to belong to the training section, which I would be explaining a little later on. The only thing that you need to understand now is bias. Bias is just another value or parameter associated with a neuron. In my and most of the implementations this value is added to the accumulated incoming value. You will better understand this when we see code for running the NN. For now see the code for creating the net:



Basically, what we are doing above is: Now lets see, how do we run a neural network:



What we have done above may be summed up as: I would like to explain that activation function. What this function does is that, no matter what number you pass, it always returns a number between 0 and 1. This is because we want the final value of every neuron between 0 and 1, but what if it comes to be something like 2.5 or 1.25, etc. Thus, in order to avoid this incompatibility with standards we use the activation function. The function is something like:



I will suppose you wouldn't like to get into the mathematical details(hurray!). In case you like, you can easily google it and find out.

Training

Training is the most important part of a neural network and the one consisting of the most mathematics. We'll be using Backpropagation method for training the NN. I would be explaining only the basic idea how it is done and not all the details. And you need not worry, just apply the formulae written in the code and you can get the training up and ready. Always remember, it is not necessary to know the details of any system in order to get something practical and working out of it. The best example illustrating this principle is Charles Darwin(what?). Yes, at the time when he wrote 'On the Origin of Species', DNA was not known. So, he propounded the evolution without even knowing the method of how it is done i.e. how traits are passed on from parents to offspring.
Back to NN training, first lets see the code:



So lets see what we have here in arguments, inputdata a sample input array and outputdata, its corresponding output which we require the NN to produce.

This training procedure must be repeated for larger number of samples so that our NN can produce accurate results for untrained input samples.
Yes, I know I haven't explained the training part in details(well practically zero). You see, I had written this code 1-2 years back and was not actively involved with NNs. During that period I have forgotten all the mathematics behind Backpropagation. But anyway, If you want to delve into the details, Google is to your rescue.

Practical Applications

There are numerous applications of NNs limited only by your imagination. Innovation is key to success, so dude use NNs to create something which will revolutionize the world!
For the sake of writing :) a few applications are given below:

Further Readings

There is more theory in this world about NNs than you can read in your lifetime. There are Hopfield networks, Recurrent networks, NeuroGenetics, etc. They are for people who really want to do serious research in this field. But in case, you want to read further, you can. Internet is a great free information highway. You can get anything you want on the internet if you know how to search effectively. Even if you don't, train a NN to fetch NN tutorials for you :-)
Thanks for reading this basic tutorial, Hope you enjoyed the ride. This tutorial was provided by our partner, ParasChopra.com

Click here to download the accompanying code.