Results 1 to 7 of 7

Thread: WILL's AIUnit.pas (NNs using GAs to learn)

  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    WILL's AIUnit.pas (NNs using GAs to learn)

    Hey all. I was wondering if anyone out there knew much about using GAs with NNs?

    I had made this unit quite some time ago to assist in the use of training a bunch of NNs with the use of a GA ran through various generations of trials in which they would learn to adapt to the inputs given and respond in a way that benefits them (ie a health score).

    I've derived the classes in this unit from a minesweeper tutorial by Mat Buckland on GAs and NNs at ai-junkie.com. If anyone can take a look over it and see if there is anything that I may have gotten wrong, I'd be grateful.

    My re-implementation of his mine-sweepers program in Pascal was so far unsuccessful as my little bugs don't seem to be learning anything.

    I'll post the 'Bug World' code later. I just want to see if I made any errors in this unit that might be causing it. Actaully you can grab the code at an old site that I put up a few years ago: http://aiworkshop.tripod.com/ Full source is there too. (used Delphi 5 and DelphiX components)

    Perhaps if someone were to try and use it themselves for testing?

    Oh and for the record the code submitted by Chris Reitzel on the tutorial does NOT work [size=9px](it seems that noone cared to check his work for results before adding it :roll: typical)[/size]

    Digital Mode seems to work better then Analog as I've actually seen some results in a another simulation I've done than the minesweeper clone attempt.

    [size=9px]Oh and please bare with some of my code, it's a bit dated and I'd likely have done a few things differently these days.[/size]


    EDIT: Darn! the [pascal] tags are screwing up the code you'll just have to get it from my old site then. The source is there in with the bug world code.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2

    WILL's AIUnit.pas (NNs using GAs to learn)

    Yep, played with GA and NN's quite a bit. The biggest trick is getting the mutation code correct. I wrote an article about the topic for Delphi Mag a while back, unfortunately it never got posted as it was to long. I'll have to look around and see if I can find a copy.

    BTW: A good thing to look at is storing the weighting method as a pointer and choosing random starting weighters. Then you can use that as part of your mutation in a 1 of n scale. Its very interesting how the results change and the curve modifies when you use this method.

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    WILL's AIUnit.pas (NNs using GAs to learn)

    Ok cool. Well if you have time to do a quick look over my Bug World code that'd be great.

    It's been a few years since I've touched it, but I'd really like to resolve this issue that stops the NNs from training properly.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4

    WILL's AIUnit.pas (NNs using GAs to learn)

    I did AI at University, so I know ab it about it. I'll have a look if I get time.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    WILL's AIUnit.pas (NNs using GAs to learn)

    That'd be great Dean. I'd appreciate it.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6

    WILL's AIUnit.pas (NNs using GAs to learn)

    Hi WILL, my ants are based on the same NN/GA code from ai-junkie. It works quite well and its been slightly improved from the original version.

    Feel free to download it, you’ll have the code there.
    [size=9px]BEGIN GEEK CODE BLOCK
    <br />d s-- : a24 GB GCS GTW GE C++ P L+ W++ N+ K- w++++ M- PS+ PE+ Y- t+ 5+++ X+ R*
    <br />tv b+ DI++ D+ e++ h+ G-
    <br />END GEEK CODE BLOCK[/size]
    <br />Create your own GeekCode block at: <a href="">...</a>

  7. #7
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    WILL's AIUnit.pas (NNs using GAs to learn)

    Oh ok... uh, where exactly is this? :scratch:

    EDIT: Oh wow, I completely forgot about your Ants program. How silly do I feel. :lol:

    Anyhow, I don't see the source code anywhere in the thread or on the page. Did you release it?

    Also, besides the simulation it's self are you doing anything different in the way that you 'teach' the NNs using Fupster's method? I tried to follow it to the 'T', or as close to it as possible.

    If you can feel free to look over and dissect my code for the Ant World program.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •