Wednesday, July 20, 2011

SCHEMENAUER AND THE XOR GATE

SCHEMENAUER AND THE XOR GATE

IMPLEMENTING ANN IN PYTHON

I was searching for Artificial Neural Networks (ANN) implementation in Python. I came across the following;
  1. FANN - C library with python bindings
  2. PyBrain
  3. NeuroLab
  4. PyNN 
  5. BPNN - Not a library, solitary script by Neil Schemenauer
THE XOR PROBLEM

The XOR problem has some history in the evolution of ANN methods. The XOR function is not linearly separable and cannot be realised using only one layer of ANN.

TINKERING WITH SCHEMENAUER'S CODE

Schemenauer's code has default training values for a 2 input XOR gate.


Schemenauer recommends using of a (2,2,1) network (viz. a network with two input, two hidden, and one output nodes) and the output is very much as desired, in the limits of errors of the ANN.  

XOR Output for a (2,2,1) Back Propogation Neural Network;
([0, 0], '==', [0.025608579041218795])
([0, 1], '==', [0.98184578447794768])
([1, 0], '==', [0.98170742564066216])
([1, 1], '==', [-0.021030064439813451])
However, playing around with the number of hidden layers has interesting results,

XOR Output for a (2,1,1) Back Propagation Neural Network; 
([0, 0], '==', [0.0020536886211772179])
([0, 1], '==', [0.68437587415369783])
([1, 0], '==', [0.68413753288547252])
([1, 1], '==', [0.6856616998850974])
The output of (2,1,1) clearly confirms the XOR problem !

Increasing the number of hidden layers indiscriminately, leads to anomalous output.

As an example, XOR Output for a (2,25,1) Back Propagation Neural Network;
([0, 0], '==', [0.99999643777993841])
([0, 1], '==', [0.99999911082329096])
([1, 0], '==', [0.99999280130316026])
([1, 1], '==', [0.99999824824488848])

Anomalous behaviour comes into play from about 12 hidden nodes.


REFERENCES
(1) An introduction to neural networks

17 comments:

Luke Dunn said...

the bigger your brain the more likely you are to get in a muddle !

Arkapravo Bhaumik said...

lets say ! a small brain is bad (2,1,1) .... a medium sized brain is good (2,2,1) ..... and large ones (2,25,1) are crappy

johnypoipet said...

I like your blog,I sincerely hope that your blog a rapid increase intraffic density,which help promote your blog and we hope that your blog is being updated.
IWIN89

Rahul said...

great articleVideo Player

Gaganjot Kaur - Mobile App Developer said...

Download Video Player

Rahul said...

Download Video Player | Windows Media Player | Best Media Player

CnX Player said...

Very nice and hepful post. CnX Player is a fantastic Video Player and offer a Casting feature that gives an absolute freedom to all its users to cast ANY (literally ANY) video format and ANY video codec from PC to TV within a fraction of seconds!

@CnXPlayer available on Windows 10, Android and iPhone/iPad

* Download Media Player from Windows 10 - Microsoft App Store
* Download Video Player from Android - Google Play
* Download Movie Player from iPhone/iPad - iTune App Store

For more information visit our website at Best Video Player

Kailey Robinson said...

Thanks for the always useful information. This is great information to help peoples and nice article written by writer. CnX Player is a powerful & efficient 4K ultra HD enabled video player for Windows 10 PC & Tablet, Android and iOS – iPhone & iPad.

Download Media Player for Windows 10 - Microsoft Store
Download Video Player for Android from Google Play
Download Video Player for iPhone/iPad from Apple App Store

Big Gaming Agent Singapore said...

Big Gaming casino games or online games are suitable more trendy at the present time because it saves you a lot of time. You can play them without even having to download your PC, so saving you a lot of time, specially if you don’t have a speedy internet connection or a powerful laptop or Mobile .
Singapore Big Gaming Trusted Casino games also known as online games are more suitable to play since they are simply accessible and you can play them with new group from around the world without the required for server.

BIG GAMING CASINO said...

Online casino are very simple to play. You do not have to any gambling skill, activities, and strategies to let the twist in a slot machine. BigGaming Jackpot Gambling winning can come at any time. From the newest BigGaming online casino to well recognized favorites, progressive jackpots are a big facet of most gambling sites. These jackpots occupation by pooling mutually all the bets located on them, anyway of the casino into one huge reward finance.

bamgosoo said...


Definitely, what a fantastic website and revealing posts,
I definitely will bookmark your site.Have an awsome day!

Click here to chceck my blog :: 풀싸롱
(jk)


Masashi said...

Very good site buddy, hopefully useful for webmasters.
Free live service to get the most accurate lottery numbers we provide, please visit

Bocoran Hk
Prediksi Hk Hari Ini
Prediksi Sydney Hari Ini
Prediksi Sgp Hari Ini

Allbet Casino Singapore said...

When Playing Sicbo online casino, you can place multiple bets at once. SICBO Online Casino usually allows betting on up to 16 areas per one roll. But I wouldn’t advise betting on that many. Sure, you’ll win multiple bets. Other than how many will you lose in the procedure?

UFA88 said...

Your article is very good. Is an article that provides knowledge for living quite well
wordpress
ufa88kh.blogspot
youtube
SA GAMING

Rahul said...

"Very nice and helpful post. CnX Player is a fantastic 4K HDR Video Player and offer a Video Casting from PC/Mobile to TV feature that gives an absolute freedom to all its users to cast ANY (literally ANY) video format and ANY video codec from PC/Mobile to TV within a fraction of seconds!

@CnXPlayer available on Windows 10, Android and iPhone/iPad

* Download Media Player from Windows 10 - Microsoft App Store
* Download Video Player from Android - Google Play
* Download Movie Player from iPhone/iPad -Apple App Store

For more information visit our website at Best Video Player"





















Ufa88kh said...

Thanks a lot for sharing that article with your audience.
thanks!
wordpress
ufa88kh.blogspot
youtube
ប្រដាល់តាមអនឡាញ


Ultimate 4K Ultra HDR video player with Video Streaming to TV said...

Nice Post