August 28, 2007

Client Progress

In between bouts of painting and drywalling, as well as class and much needed napping, I’ve been able to get some more work done on Distributed Neuron. The code is fulfilling all my wildest dreams (except that one involving a beach and Jessica Alba…). It is very flexible and easy to update/manage. The time put into planning and designing a coherent layout is starting to payoff as I add features and more functionality.

Done

There are a slew of minor updates, best listed as bullet points:

-I recently implemented growth hormones as mentioned here.

-A simulation class has been built to manage the logistical details of running a simulation (physical dimensions, health blobs, location of organism, physics, etc).

-The client code is now autonomous, meaning it can recover itself from crashes as well as load new experiment/trial parameters when one trial finishes.

-Mutation has been completed on the entire genotype. Mutation is controllable by a value in the experimental parameters table, which is unaffected by mutation. This is so I can slow down or speed up mutation at will.

To Do

Oh but there is still much to do. In the next few days I am going to write up the initial fitness function. After this function is written I can begin some limited runs to create a starter population. Next on the drawing board is implementation of crossover mutation (sex FTW!) and running more lengthy trials to make sure the whole operation works.

If at that point I haven’t hit anything catastrophic, the next step is to work on the network code and start the server code. Which I’m not looking forward to but it is a necessary evil. So much to do, so little time!


August 15, 2007

Digital sex is complicated

It turns out digital sex is a lot more complicated than I had originally thought. A key aspect to genetic algorithms is crossover between pairs of individuals. This crossover is made to reflect the genetic pairing seen in most eukaryotes. It is an artificial way to distribute genes from the parents to the children. Crossover is important because without it, a genetic algorithm is little more than a random search. Crossover (theoretically) lets the organisms traverse the fitness landscape quicker because common building blocks are passed from parents to children.

Techniques, thoughts and a cool adaptive study after the jump.
Read the rest of this entry


August 11, 2007

SQLite loves me, RAM hates me

Non-technical version: DN now uses the database to load and save data. Hooray! It eats RAM like candy but that is expected and can be somewhat fixed. Speed is still a concern but real optimization will come later once the codebase is solid.

Next step is to begin working on the client in earnest and get some simulations running! Gruesome technical details for those that care after the jump
Read the rest of this entry


August 9, 2007

Design Decisions - Growth System

This is the first of many posts in the new category “Design Decisions”. These posts will chronicle my thought process as I work through various problems, both technical and philosophical.

The first problem that should pop up in any brain simulation project is also one of the most difficult to answer. How does a brain grow? Is the particular structure of the human brain required for intelligence?

Discussion after the jump.
Read the rest of this entry


August 4, 2007

No more file format woes

As I was working on the new unified file format today, I couldn’t help but think to myself “Wouldn’t a relational database be great right now?”. But of course, relational databases are exclusive to server environments.

I had completely forgotten, until today, about SQLite. SQLite is a wonderful flat file relational database. I have used it previously in another project (funnily enough, another distributed project - Distributed Backup System). It supports the majority of the SQL protocol, is ACID compliant and is super simple to use. There is even a C++ wrapper so you don’t have to use the C style function calls. To top it off, there is a free database editor GUI available.

Frankly, I am ecstatic right now. This will cut a tremendous amount of time off saving/loading code and will be more flexible to boot. Because of the database, I’ll be able to save statistics and useful data much easier, meaning more scientific value from the project (and less headache for me). I am now planning on including some features I was hesitant about because of the hassle in programming (such as crossover mutations).

The one concern I have is physical size. With the power of databases come the inevitable increase in physical hard drive usage. Hopefully I can find a happy medium so volunteers are not required to sacrifice a large chunk of HDD space for data collection and storage.


July 25, 2007

Back from Vacation!

Well, I’m back from vacation. Time to get grinding again!

I experienced a minor setback while working on DN, admittedly my own fault. In anticipation of getting a functional alpha prototype working, I committed the single worst mistake a programmer can make - no design document. While the design document itself can be anywhere from hastily scrabble notes to entire bibles, the need for one is paramount. I rushed into the client code and began hacking left and right. The client kinda works right now, and while I could spend time to fix it, I shouldn’t. It is ugly, unwieldy, unreliable and will not scale well.

Two steps forward, one step back.

Read the rest of this entry


July 4, 2007

DNClient

Work has started on DNClient, the distributed client that volunteers will run. The brain network code has been placed into a separate DLL for ease of updating later down the road. The client has a fairly simple program flow:

  • Check for new versions of client, Brain.DLL, evolution parameters, genotypes
  • Load current genotype/phenotype, depending on the progress of the client simulation
  • If a genotype is loaded, mutate genotype and create phenotype. Proceed to next step.
  • Run trial on currently loaded phenotype
  • Score fitness, record data
  • Repeat

Granted, this is a grossly simplified version, but it gives a nice overview of what is happening client side. Server side should be a fair amount more interesting. The server will have access to the results of all clients and will make “educated guesses” on which genotypes to keep in the genepool and which to remove. I’m currently reviewing various algorithms for deciding which genotypes are fit. Many algorithms allow less fit genotypes to persist because it increases genetic diversity and avoids local maxima, which genetic evolutionary algorithms tend to get stuck in.

I’m also trying to decide if, and how, I want to implement genetic crossover. Crossover is a fancy term for “computer sex”. Crossover takes whole portions of a genotype and transplants it on another genotype, giving the child genotype largely intact pieces of its parent’s genotype. The current client merely mutates the genotype by a small amount each time. I can see the benefits of crossover, as it could potentially take important pieces of genetic material from two fairly unsuccessful parents, but when paired together, create a fantastic child. It does, unfortunately, require some more coding I hadn’t counted on and will require clients to keep a limited genepool they can use to cross.


June 28, 2007

Let’s get physical

Its nice the networks are now firing and can even demonstrate regionality in firing patterns. However, without a physical body, they are little more than flashing lights. Imagine how useful you would be without a body!

Bodies in DN are very simple right now. Each body comes equipped with two “muscles”. One controls the rotation of the body, affecting orientation and field of view. The other muscle controls thrust, resulting in movement in the direction the body is currently pointing. The simulated environment follows frictionless newtonian physics which means the networks will be learning how to play a simplified game of Asteroids.

Read the rest of this entry


June 26, 2007

First Synaptic Firing Test

The first synaptic firing test was a complete success. The test bed was a network of 1000 neurons contained in a 50×50x50 cube. Each neuron was connected to 50 other neurons via synapses, resulting in 50,000 synaptic connections. Each cycle of the program executes anywhere from 2ms (0 neurons firing) to 64ms (350 neurons firing, 15,000 synapses activated). 60 cycles were exceuted.

The testbed consisted of four neurotransmitters (A,B,C,D) seeded at random locations in the physical network. Transmitters A and B were given overwhelmingly strong excitory attributes while C and D were given very weak inhibitory attributes. This was done on purpose to test the synaptic connections and make sure my code was functioning. Five neurons were artificially stimulated to start the test.

The test worked wonderfully and even showed some oscillatory behavior, as evidenced by this video (apologies for the quality):

Read the rest of this entry


June 10, 2007

Neurons

Neurons, as in the brain, are the base “processing” unit of DN. Unlike most neural networks in existence today, DN’s neurons look like this:
Neuron

Rather than this:
ANN

DN takes the approach of modeling real biological processes. This means the neurons in DN have bodies, axons and dendrites. They are somewhat crude approximations in that they are simplified but they are far more flexible than the current artificial neural nets being used.

Read the rest of this entry

Next Entries »