Archive for May, 2005

TFNN - MRI Heaven!

I've reached that point now where so many things are coming together that I'm going out of my mind with excitement. In truth I haven't accomplished MUCH more in the last few days than I have during the rest of the project, but with the graphical view of the neural net, I'm really seeing it come alive like I never have before, and it's just amazing. More pictures today.

First off, I played around a bit with generating a larger matrix and adjusting threshold and weight values. Here is a 3000 neuron matrix I generated for Milo

Really beautiful to watch something of that size spinning around in front of you. I added code that allows you to adjust the distance from which you view the neural net - not a big deal, but nice for ease of viewing.

I also wanted to test my theory about the current synaptic modification functionality leading to cascade overload in the net. I generated a 1000 neuron brain for milo, connected Milo's touch sensors to 4 input neurons in the corner region, increased default synaptic weight across the net to speed up the process, turned it on, touched Milo's antenna, and BOOM, one massive (and deadly if biologically experienced) seizure:

It was amazing, at one point just the local region to the input neurons were active. Then 25% of the net, then as neural pathways looped back and synaptic strength was increasing, 50% of the net was active, then 75%. After 30 seconds or so there were maybe 1 or 2 orphan neurons that weren't active, but that was it. Definitely proved the fact that the current synaptic modification code is wrong and needs to pattern Hebbian Learning.

Tonight I finished the code that displays synaptic links between the neurons. From the visuals you can't tell which is the presynaptic neuron and which is the post, but this isn't TOO too important when viewing in this scale anyway. What it does tell you is the strength of the synapse from the color. A greener synapse means a weak link, while a bluer synapse means a strong link. Here is a picture of a 100 neuron matrix at rest with random synapses assignment:

The great thing is, I was finally VISUALLY able to test out the global synapse degradation scheme. I jacked up the time frame so the synapses degraded much more quickly than normal, turned the brain on and let it just sit, with no input being fed into it. I slowly watched as strong synaptic links weakened over time into green links due to lack of exposure to "virtual neurotrophins".

Then I regenerated the same net but this time touched Milo's antenna, and watched in amazement as neuralogical activity burst to life. It's hard to tell from this picture, but if you watch it while it's spinning around you can tell that activity happens primarily along strong links and seldomly along weak links, which is expected in the current scheme:

The one problem with the synapse visualization is for anything but small matrices. After a certain point there are so many synapses that it floods the screen, making the visualization not only useless but also extremely slow.

Pretty neat to look at though, for a moment I felt like I was looking at real neurons, it kind of sent a shiver up my back.

Anyway, thanks to the visualization code I can safely say that everything so far is working the way it should be, now onto fixing the synapse modification - very excited!!

TFNN - Functional MRI Scans

Today's a very exciting day - I spent quite a bit of time working on the code for the graphical representation of a specific neural matrix, allowing me easier study of activity once the experimentation starts on a larger scale.

No matter how much work you do, it's always kind of breath taking to see a graphical representation of your work, actually see a result as opposed to just code or theory in your head. This OpenGL (GLUT) graphics code visually represents the network like a virtual kind of MRI. It represents inactive neurons as white, and active neurons as red. Currently the synapses are not drawn or represented in any way - though this is planned next time I sit down with the code. They will be represented in different shades depending on the strength of the link.

Anyway though - PICTURES, I can't say how excited I was - I generated a 100 neuron neural matrix with a synaptic density of 3 - meaning that each axon had (on average) 3 post-synaptic neurons connected to it. I connected a portion of the neural matrix to the touch sensors on Milo.

Here is a "virtual functional MRI scan" of Milo's 100 neuron brain at rest:

The next three pictures are various shots of activity while I'm touching Milo's antennae



No synaptic alteration code in effect right now during these phases, so no learning - but there are synapses established in this brain and we see activity! I'm not sure I would call it thought since there is no plasticity amongst synaptic connections, but it's definitely a beautiful thing to see.

I want to finish off the visual representation of synapses next time I sit down with it, then onto adding the synaptic alteration routines.

TFNN - Another step

Update for today - I spent a great deal of time today simply porting the code over to work in Visual Studio .NET (You'd think C++ code is C++ code, but today's IDEs are so complex that it takes half a day just to get the project setup properly).

I also downloaded the header and source files for the Lego RCX brick interface, and played around with them for a while. There's pros and cons to executing your program on a computer and then directly communicating with the RCX block for input/output. The pro is you can execute any size program without the memory or processor constraints of the RCX brick, and can write the program in C++. The con is the infrared transfer rate is 2400 BPS between the lego tower and the brick, with an average instruction size of 16 bits, so the latency involved with input from the brick to the computer and output from the computer to the brick is something like 150-180ms all said and done.

In our scheme, this 150ms transmission delay is equivalent (in idea, not in actual numbers) to the propagation delay of sensory input at the tips of the fingers up the spinal cord to the brain. 150ms is a very long time, relatively speaking, which isn't so good. To drive the point home a bit more - a 150ms central nervous system is about equivalent to 7hz. The computer currently running the brain operates at 2.4GHZ, which is 2576980377.6 hz. Just ballparking figures, assuming we have a 100,000 neuron brain, and each neuron takes 50 cycles to compute, we have the brain operating at around 515 hz, which is 73 times faster than the nervous system. I'm not worried too much about it as these are just simple tests in a simple body, not the primary prototype robot. 2400 BPS is slow, but I think it will be okay to study neural pathway organization.

I modified code tonight as well - first I cleaned up some deprecated code and took it out - it was just messing up my source and I know I'll never need it again. I fixed the portion of the code that sets the post-synaptic partner of a neuron, allowing you either to pick another neuron, or an output (integer), this allows you to send output back out of the brain, eg to motors or speakers or whatever. I also added some functionality to the matrix code that allows you to refer to a specific neuron within the matrix, so the programmer can set specific threshold values for a neuron or synaptic weights for a neuron, through the matrix the neuron is contained within. This already helped me a lot in the experiment I ran tonight -

I created a single neuron brain for Milo, connected his antenna touch sensors as the input to the neuron, and connected the output to the sound processor within the RCX, specifically triggering off the beep code. I set the threshold of the single neuron to be 3 pulses, equivalent to 3 "doses" of glutamate (or whatever way you want to look at it, potential charge, etc). The result? Success - if I tapped Milo's antenna antenna less than 3 times in a specified amount of time, he did nothing, but if I went past that threshold Milo beeped - his first communication! It may not sound like much and still very algorithmic - but it shows the neuron itself does indeed function properly when connected to inputs and outputs. A single neuron brain isn't much of a brain at all, but it's definitely a start!

Originally I was planning on connecting two neurons together tomorrow and fixing the Hebbian Learning routine, but I think I'm going to wait on that until I get the code going for a graphical depiction of the net. It's very difficult to just work with the integer values of synaptic weights and reading messages on the screen, it would be much easier to see a graphical, color coordinated representation of the ANN.

So, tomorrow I'll be working on introducing some code that assigns a spatial configuration to the neural network, along with code to show the net graphically.

Still to do is fix the matrix generation code (to work with the new spatial coordinates, its pretty random and crap right now, and it loops back on itself in a strange manner - its generally bad and needs to be redone), and I still need to take out the static/linear increase in synaptic weight on every neural activation and instead write code for a Hebbian scheme.

Milo is already infinitely smarter from yesterday (When he didn't have a brain at all), so we'll keep on working upwards!

« Previous PageNext Page »