Shop OBEX P1 Docs P2 Docs Learn Events
artificial neural network in pbasic — Parallax Forums

artificial neural network in pbasic

jonlink0jonlink0 Posts: 11
edited 2010-12-25 20:14 in General Discussion
Hello everyone,

I'm currently working on emulating the drosophila fruitfly neural network. I was wondering if anyone here has a neural network implemented in pbasic, and if you do, please post the source code! I truly appreciate your help. And happy holidays!

I'm new here, so I hope this is the right board... :D

Comments

  • jonlink0jonlink0 Posts: 11
    edited 2010-12-25 14:13
    OK, I did some research and it seems that the BASIC STAMP isn't capable of running multiple threads easily, so the propeller's multiple processors would be better suited to running a neural network. (sry, I'm a bio major, so my hardware skills are minimal) So to clarify, a neural network programmed in C, SPIN, Javelin, propBASIC, or assembly would be greatly appreciated too.
  • LeonLeon Posts: 7,620
    edited 2010-12-25 14:31
    Stuff like that is best developed on a PC, initially. When the application is working, it can be ported to a suitable target.
  • jonlink0jonlink0 Posts: 11
    edited 2010-12-25 14:50
    Sorry, I should clarify:

    I'm working on a robot that uses a neural network modeled after the drosophila brain. The neural network will control the robot and learn based on inputs given to it by the robot. The simulation is approximate, using the drosophila brain as a guideline, while placing emphasis on learning as opposed to 3D flight and high-fps vision, which the drosophila brain is specialized for. Since the artificial neural network will be contained inside the robot, power, memory, weight, cost and speed constraints become important concerns in the design. I am thinking I should develop in a microcontroller language, since the target platform is a microcontroller, not a PC. I have been looking at neural net algorithms that run on PCs, but having a neural network program designed to run on a microcontroller would be much more helpful.
  • LeonLeon Posts: 7,620
    edited 2010-12-25 14:54
    It should still be developed on a PC, to start with. You will find it much quicker and easier.
  • rod1963rod1963 Posts: 752
    edited 2010-12-25 17:28
    This is definitely a project that needs to be prototyped on a PC given it's complexity and that most of the NN tools and sources are PC based. It's not something you want to debug on a robot.

    As far as C code examples go, you have to be specific as to what sort of NN models you are looking for.
  • jonlink0jonlink0 Posts: 11
    edited 2010-12-25 18:43
    How do you recommend that I prototype it? I can't find a pbasic, spin, propASM, propbasic or javelin compiler/interpreter for the pc. Are you suggesting I write the code in something like VB, and then rewrite it in pbasic?

    The ultimate goal is to have a recurrent neural network with >=30 neurons, with weights controlled by a genetic algorithm. I realize this is less like a drosophila and more like a rotifer brain, but the goal is to emulate behavior (phototaxis, object avoidance etc...), so a large amount of neural circuitry is unnecessary. The robot starts with a population of 10 or so random neural networks and tries each one successively for a given amount of time x minutes. After it has tested all neural networks in the population, the ones which caused the greatest increase in pleasure/decrease in pain (determined by, for example, an accelerometer... see ( http://headphones.solarbotics.net/learnbot.html ) for a similar robot) are sexually reproduced and mutated. After, say, 100 generations (1000x minutes... learning will take a while) the neural network should have learned to emulate a braitenberg vehicle. The network size can then be increased and the robot retrained.

    The plan is to program it incrementally, starting with a NN-based braitenberg vehicle and adding the genetic algorithm and peripherals as the ANN grows, so I don't see why complexity would be a problem to begin with.

    For code examples, anything utilizing a genetic algorithm to modify neuronal weights would be great.

    Thanks again!
  • FranklinFranklin Posts: 4,747
    edited 2010-12-25 19:29
    If you don't find what you want in the object exchange you are probably on your own.
  • jonlink0jonlink0 Posts: 11
    edited 2010-12-25 20:14
    Thank you very much for all of your suggestions, and I will take them under consideration, but please send project-related comments to http://forums.parallax.com/showthread.php?128242-learning-robot-project ,

    @Franklin, is there a pbasic obex?
Sign In or Register to comment.