Artifical Neural Network MLP BP Lib

User projects written in or related to FreeBASIC.
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Artifical Neural Network MLP BP Lib

Postby mambazo » Apr 02, 2006 14:17

This is a subsection of my college project work. The lib will be used to recognise real audio guitar chord signatures eventually, but heres a little demo to get your toes wet!

The lib is a single 6k .bi file and already it can do some pretty funky stuff!

Download Demo


Command List:

NCreateNetwork
NSetLayer
NBind
NLearn
NCalc
NSave
NLoad
Last edited by mambazo on Apr 03, 2006 19:41, edited 1 time in total.
coderJeff
Site Admin
Posts: 3158
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Postby coderJeff » Apr 02, 2006 15:40

Fascinating stuff! I see that the NN is just taught letters. So when I selected `7' the NN returned `Z'. All things considered that's a good guess. It really felt like my computer was thinking. Great work.
counting_pine
Site Admin
Posts: 6176
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Postby counting_pine » Apr 02, 2006 17:51

What's it supposed to do? When I run it, it just crashes after about 5000 iterations.
Sisophon2001
Posts: 1704
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.
Contact:

Postby Sisophon2001 » Apr 03, 2006 1:25

Hi:

I don’t have a compiler here, but I think you missed one out of bounds that I noted on an earlier version.

For i = 0 To 25
Next
Print i

will print 26, so the array sure(25) can go out of bounds on the last usage.

Compile with –exx to check the code is working.

Garvan
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Apr 03, 2006 2:49

out of bounds on line 172... and it took sooo long to do 5,000 iterations too /tear...
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Postby mambazo » Apr 03, 2006 7:54

Thanks chaps. I'll upload the fix shortly. Thought I caught all those bound checks in the last view. I'll use -exx from here on :P lesson learned

EDIT: Updated the download.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Apr 03, 2006 13:06

nice work =) don't want it crashing when you show it to your teacher ;p
voodooattack
Posts: 605
Joined: Feb 18, 2006 13:30
Location: Alexandria / Egypt
Contact:

Postby voodooattack » Apr 03, 2006 13:11

Amazing work indeed..

I really like the network's design, but i think its a little bit slow.. somehow :)
I know its just a start, but you should concentrate on the speed as your primary target.

I'd suggest using single precision FP instead of double precision FP, this could definitely double the network speed (i've done that to your network and tested it) ;)


Code: Select all

Aborting due to runtime error 6 (out of bounds array access) at line: 203


I think you forgot to update the 25 in the last for loop (at line 195)

Keep up the good work :D

Best regards..
--voodoo
Pritchard
Posts: 5493
Joined: Sep 12, 2005 20:06
Location: Ohio, USA

Postby Pritchard » Apr 03, 2006 13:23

This is fricken amazing. I'm trying it out with all sorts of different settings. If you can continue to work on it, I'd love to see this grow :D
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Apr 03, 2006 18:03

I like this. This is the first NN example that i've been able to modify successfully.

For me + and - cause a crash.
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Postby mambazo » Apr 03, 2006 18:11

Thanks for the suggestions. I'll get to work right away and let you all know when there is an update!
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Apr 03, 2006 18:51

I found this, it was causing the certainty to be wrong.

Code: Select all

PRINT "Certain: "; CSNG(5-sure(i))/5*100; " %"


Should be

Code: Select all

PRINT "Certain: "; CSNG(5-sure(isure))/5*100; " %"
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Postby mambazo » Apr 03, 2006 19:40

good catch, i found that too :P

I've made some nice updates! NSave and NLoad now work fine. there is a pre taught network there now for you to load if you want.

Also, I've changed the learning algo a bit, now it learns WITH distortion, so it is very accurate right up to a 50% distorted input. *pats on back* ;)

The download above has been updated!
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Apr 03, 2006 20:54

Can this type of network be used to make something like this?

http://www.20q.net/

Its the old classic 20 questions game.
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Postby mambazo » Apr 03, 2006 21:14

Yes, it can :) Not sure exactly how you'd do it, but it is possible. Each question would influence one input of the network, or something.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests