Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Trying to get better at Neural Networks

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 11th Feb 2012 14:23 Edited at: 11th Feb 2012 16:37
I have had a few attempts at Neural Networks...

http://forum.thegamecreators.com/?m=forum_view&t=168058&b=8&p=1

I am now working on a Robot. But I never really got the Tank working, so first I need to try to understand the code properly.


Quote from link....
Quote: "Someone correct me if I'm wrong, but I could have sworn that || was a standard OR operator, not an XOR operator. "


My first question is... is this correct... || or should it be ~~

Code here...


BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Feb 2012 20:08
|| is OR
~~ is XOR

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Feb 2012 01:26
OK, but do Neural Networks use OR... or do they use XOR?

The thing about my tank is that is scores for hitting the mines, and is supposed to hit the mines. But eventually it gets really good at dodging between the mines.. I can train it to dodge the mines by scoring it to hit the mines. Which is backwards. So I don't know why the learning is back to front. I don't understand OR/XOR. So I am wondering if that is the fault.

I want to understand the code properly. My reason for the project is not that I am any good at maths, it is because I have an idea that alters the method.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Feb 2012 01:56
Ok changed the OR for XOR, and the movements look more complex, so I think it is a good sign. Now I will lengthen the epochs.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 12th Feb 2012 02:10
Hi Pincho, long time no see. Good luck with this, always trying an interesting project as normal I see I'm busy with AppGameKit myself having fun going back to Amiga style games. Heres a link to my latest demo if you want a peek.
http://forum.thegamecreators.com/?m=forum_view&t=194270&b=48

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Feb 2012 03:21
Yeah I remember a Psygnosis game like that. I thought it was Menace with a red ship, but Menace didn't have a red ship.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 13th Feb 2012 16:36 Edited at: 13th Feb 2012 17:20
I have decided to try a different method, because the last method seems to only remember 15 bits, and I can't figure it out. So now I am trying to convert VB code to DBPro code. They have different outputs however, and I'm not sure if the DBPro version is correct, or not... DBPro...

EDIT: Fixed it



VB.....



VB Test Code...


DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Feb 2012 01:33
You had a look then? Try it out at all? I am looking for gameplay testing off peeps who try the demo. This neural net business looks a bit complicated for me yikes! What are you hoping to make from it?

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Feb 2012 03:23
I hope to make a Robot simulation, but first I need to get my Think Tank working properly...

http://www.youtube.com/watch?v=zBtt-iVqvFE

Penfold
22
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 24th Feb 2012 00:12 Edited at: 24th Feb 2012 01:58
This is frankly amazing !!..

Ive just read a ton of stuff on this purely based on your posts.

The youtube video has shown me something your perhaps not aware of.

Your tank *loves* green mines. I think you might be missing the point. Even though the tank seems to be dodgding the red mines this is in fact wrong. Its actually driving towards the green in most if not all cases. It will see the red in view but steer towards green and grab it instead (the only time this changes is if the turning arc on your tank is too big and it spots a closer green and goes for that instead).

If you want to get it to drive towards red instead you have to make the red higher bias for the *fitness* or whatever point system you use.

Fantastic work though.

<edited>

Ive started dissasembling your code from your *old* post , are you still using tis for the basis of yuor newest creation? If so I might be able to help you shrink the code a bit to make it easier to work on (there is a little bit of unneeded code duplication in there amongst other things) fi you need a bit of help with that. Also is the origanl tank obj available for me to borrow so I can see if i can get my modded code to work?

'Ooh 'eck chief'...'crumbs'
Penfold
22
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 26th Feb 2012 01:14 Edited at: 26th Feb 2012 01:17
Ok so I got RiDii's version and your version smashed them together added a bit of my own spark and ended up with this. its fast I've left the FPS on 0 so it could go as fast as possible. it seems to cap out on intelligence at about 500 epochs but I could be wrong. I got his little blighter doing an average score of 108 which i though was amazing.

Also here's the RAWR code to play with .



<edited shifted code up>

'Ooh 'eck chief'...'crumbs'
Penfold
22
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 26th Feb 2012 23:32
Newer cleaner code with a major code issue fixed.

I can get the little fella to average out at about 120 points after about 700 epochs - can anyone get one thats smarter?

Code requires no external media just copy paste n compile.



'Ooh 'eck chief'...'crumbs'
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 27th Feb 2012 05:48 Edited at: 27th Feb 2012 05:49
The thing that has always struck me about these ANN projects is that they only seem to focus on learning through experience. What about learning through communication of experience from one to another? If everyone had to learn everything from scratch themselves we would never get anywhere. Learning from what othes have done and have experienced greatly speeds the rate of progress that's why we have books and schools right

<img>http://img209.imageshack.us/img209/1741/banneromf.jpg</img>
Penfold
22
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 27th Feb 2012 11:01
From what I've read there are more thn a few ways for these ANN programs to learn you've just mentioned what could be classed as a watch and learn style like small animals do ( and babys) which some ANN prograams do focus on ( the fish shoal simulators for instance) and also from reading books which are effectivly the taught ANN ones. Which either have thir neurons programed directly or someone uses something in the program to directly teach them.

The ANN type shown above is the unsupervised style whcih is for most people the most exciting. you just let them learn on there own and seee where they get to without outside stimulation. This is also one of the hardest to make which is why its focused on more.

'Ooh 'eck chief'...'crumbs'
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 1st Mar 2012 01:28
I'm not talking about outside guidance or direct input, I'm saying let 2 of them loose, and allow them to communicate unsupervised with each other 'in the wild' as it were and see where they can help each other get to.

I'm not saying to give them information or teach them anything before you let them loose, I'm saying let them teach each other organically, when they happen to come across each other.

One learns through experience 'Its good for me to do X when I detect Y happening.' That one later comes across the other and tells it what it has learned. The other stores that and replies 'Ok cool, here's what I found out since the last time we met...'

Thus each can learn from 2 experiences even though as an individual they only had 1 and this requires no outside interaction beyond the simulation environment.

<img>http://img209.imageshack.us/img209/1741/banneromf.jpg</img>
Penfold
22
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 1st Mar 2012 12:29
Quote: "I'm not saying to give them information or teach them anything before you let them loose, I'm saying let them teach each other organically, when they happen to come across each other.

One learns through experience 'Its good for me to do X when I detect Y happening.' That one later comes across the other and tells it what it has learned. The other stores that and replies 'Ok cool, here's what I found out since the last time we met...'"


Um yeah this is what Pincho's, Riidii's and my combined code do (they teach them selves), the only difference is you say let 2 do it and teach each other, The code could be setup to have 2 or more of the Bots (Monster/Tank) loose and then all you do is get them to share there DNA (Neuron data) at the end of an epoch to simulate mating.

The examples already made are the simpler parts. There is no point in getting to the DNA sharing part until one bot can learn properly on its own first. Otherwise you just end up with 2 dumb bots instead of one.

If you check the link on Pinchos' first post on this thread go back to his original thread and read the stuff in the first link he posted there. Theres less than an hours read and it goes into very basic laymens version of neural AI.

'Ooh 'eck chief'...'crumbs'
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Mar 2012 18:53 Edited at: 1st Mar 2012 19:00
Hey cool Penfold! Glad you had a play around with the code. I am still wondering if the OR should be replaced with XOR. XOR seems to work better for some reason. I noticed that the tank goes for the green mines just the other day, it's funny that the tank seems to be disobeying the scoring system. I have been working on a Back Propagating system but that also seems to go for the green mines. I gave red mines a score of 10,000 but made no difference. So now I am thinking of breaking everything down into steps like...

Look
Move left track
Move Right track
speed
Distance
loop

And hopefully the more parts that you can analyse the better it will work.

I have also read about RBF Neural Networks which are the best for bipedal movement (Tank Tracks can be considered bipedal movement). Unfortunately I couldn't find an example of an RBF Neural Network apart from Visual C, which I can't really understand properly. Anyway, RBF is the way to go according to the tutorials.

I will test the new edited codes later.. don't forget to try replacing OR with XOR which seems to match some other code I found on the net.

Login to post a reply

Server time is: 2026-07-10 01:05:43
Your offset time is: 2026-07-10 01:05:43