Monthly Archives: May 2005

TFNN – Another step down

Another quick update – I fixed some synapse timing issues in the Temporal Frame engine and finished up the axoaxonic code this weekend. I had a succesful test of sensitization as well, demonstrating the non-Hebbian learning capabilities of a neural matrix. Due to axoaxonic connections, a presynaptic neuron can now cause a direct increase in the synaptic weight of the postsynaptic neuron’s axon terminal (This postsynaptic neuron itself being a presynaptic neuron in another relationship).

The test was performed by generating a 3 neuron matrix. Milo’s left touch sensor was sent as input into neuron 1, while Milo’s right touch sensor was sent as input into neuron 2. Neuron 1 was connected via an axoaxonic connection to neuron 2’s axon terminal – the axon terminal creating the synapse between neuron 2 and neuron 3 in a standard axodendritic configuration. Neuron 3’s output was sent to Milo’s speaker.

The treshold rate of Neuron 3 was set higher than the synaptic weight between neuron 2 and 3, hence if Milo’s right antenna was pressed he would not beep. However, upon touching Milo’s left antenna a few times, via the phenomenon of sensization the synaptic weight between Neuron 2 and 3 was increased, and subsequent pressings of Milo’s right antenna was enough alone to cause Milo to beep, now the synaptic weight had grown strong enough to pass Neuron 3’s threshold.

Cool stuff!

TFNN – Axoaxonic Issue

I realized something today when I started fleshing out axoaxonic connections a bit – something about a flaw in the temporal frame engine itself. I can’t go too much into it, but I don’t think I would have realized it unless I had realized about axoaxonic connections, so I’m glad things worked out the way they did. It’s a fairly easy fix, so that’s good.

Also, I read a few papers on QBT (Quantum Brain Theory), and it seems like most reputable neurophysiologists don’t really buy it, and from what I’ve read I don’t really buy it either. The size and effect of the electrochemical reactions just don’t seem to leave any room for the very microscopic-natured effects of quantum mechanics, even if microtubules are a place where the magic could happen.

So, first things first, mend the engine, then I can go ahead and add habituation and sensitization effects.

TFNN – Associative Learning

This was cool, I had the first successful test of associative learning last night with a test matrix.

Just to explain what associative learning is for a second – behaviorist and neurophysiological studies have shown the following: A stimulus not normally associated with an action can become associated if that stimulus is caused simultaneous to another stimulus that IS associated with an action. EG if you shock a rat’s foot, the amygdala will process this and send a message to motor control to jump away. If you make a sound – a clap or a beep, whatever, the amygdala doesn’t perceive that as a threat so the rat does nothing. However, if you continually clap at the same time you shock the rat’s foot, the rat’s amygdala begins to associate the pathways involved with hearing a clap with those of receiving an electric shock, and hence in the future, JUST a clap will cause the rat to jump in the air as it thinks pain is coming.

On a neurophysiological level, in the lateral amygdala (in this example), there is a preexisting STRONG synaptic connection between the portion of the brain that receives the electric shock and the part the motor control that causes the rat to jump. There is a WEAK connection between the auditory thalamus and cortex and the part of motor control that causes the rat to jump – normally a clap wouldn’t cause it to jump.

However, due to Hebbian learning (triggering of NMDA receptors causing an influx of calcium that cause a genetic reaction to strengthen the synapse between the pre and post synaptic neuron), whenever the POST synaptic neuron fires off as a RESULT of a presynaptic neuron, the synapse between the two neurons is STRENGTHENED. Normally the connection between the auditory thalamus and the motor control via the LA is WEAK and not enough to cause the aymgdala neurons to fire off. However, if the rat receives a shock at the same time as it hears a clapping noise, then both the STRONG and the WEAK connections are fired over – which triggers the post synaptic neuron. Since the WEAK connection was a cause, albeit a small one that led to the post synaptic neuron to fire, its connection is now STRENGTHENED, so now (well, after a few times) its a STRONG connection like the shock neurons, so now clapping causes the rat to jump without a shock to the feet.

Anyway, that was the explanation – and I successfully tested this out in a minimatrix last night. I created a 3 neuron matrix. 2 input neurons, one output neuron. I connected the first input neuron to Milo’s left touch sensor, I connected the second input neuron to Milo’s right touch sensor, and I connected the output node to Milo’s speaker. I then created a strong synaptic link between neuron 1 and neuron 3, and a WEAK synaptic link between neuron 2 and neuron 3. Hence, touching milo’s left antenna would cause him to beep, but touching his right one did nothing. Then I began touching both his left and right antennae simultaneously a few times. The synapse involved in the right synapse grew stronger, so after this action I was able to touch JUST his right antenna and Milo would beep – he had grown to associate beeping with his right antenna whereas before he only associated beeping with his left antenna.

Awesome stuff!

Also, I have to run, but a few things I realize I’ve forgotten to include in the neuron functionality (I keep saying I’m done, I’m not even going to say that anymore, everday I realize more stuff I want to do)

FIRST: I need to fix the Hebbian algorithm as outlined above. Due to technical programming stuff it strengthens the synaptic links in an exponential fashion right now instead of a linear one. It’s easy to fix, I just need to do it.

Also, I wan to incorporate non-hebbian learning like Habituation and Sensitization. Habituation will be easy (from what I gather), it’s simply a depletion of neurotransmitters such as glutamate from the neuron, hence the neuron becomes less effective after repeated use – the overall effect being desensitization.

Sensitization requires the creation of axoaxonic connections (Axons that form synapses with other axons). As of right now the TFNN wasn’t built to handle this situation – but the awesome part is, the code that stores the synaptic gap information can easily be modified to fit pretty much ANY situation. So regardless of what lies on the other side of a synapse, the TFNN can handle it, which is pretty awesome. Had to pat myself on the back for that engineering. ๐Ÿ˜‰

Anyway, enough for now.

TFNN – Terminology update

Just a quick note – I need to think up a name for the visualization routine – the problem is it doesn’t strictly show the same activity of a functional MRI scan, but it also doesn’t show the same activity as a PET or SPECT scan. Something to think about, not really a big deal in the grand scheme of things.

TFNN – Functionality Addon

Also, while I’m thinking about it, I would like to include functionality of post-synaptic generated neurotrophins leading to axon growth and branching within the presynaptic neurons. This will be pretty easy, in the code used to increase synaptic weight, I can also setup new synaptic connections to geographically neighboring neurons. I’m not sure at what rate to do this though, from the literature it suggests it doesn’t happen as often or as quickly as synaptic reinforcement.

TFNN – Hebbian Rewrite

Just a quick update today, no pictures.

I took out the old, incorrect synapse alteration routines today and replaced them with the new routines which match the functionality of Hebbian Learning’s “Fire Together Wire Together”. I actually used a different, more efficient algorithm than what I had originally planned, so the drop in speed is nothing at all. It did increase the size (in bytes) of each neuron, but speed is more a problem than space at this point.

Now that this is finished, all the underlying functionality is (to my knowledge) correct. From this point onward it’s simply a matter of testing different methods of construction with different values for threshold rates, plasticity level, degredation amount, physical placement, etc.

Also, I would like to take a day and just sit down with the code and see if I can get it any more efficient. Right now when I start generating neural matrices in the tens of thousands level, along with a high synaptic density, the thing just grinds to too much of a halt, though this may be OpenGL processing all the graphical representation of the net and not the net taking that time up itself. I will test it out without the graphics routine running and see how it does.

But regardless more efficient code is always a good thing. I know some places where I used a little more memory than I needed and added a few extra steps, I can shave it down a bit.

Everything’s going great though! Once I activated the Hebbian routines activity no longer followed a systematic pattern, or at least I couldn’t see one – which I believe is a very very good thing.

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!

TFNN – Milo

Before I jump into today’s entry, I realized that I didn’t actually describe what the goal of TFNN is. It’s been a dream of mine for a little over 10 years now to create true Artificial Intelligence. Not a system of algorithms and heuristics that fools a spectator into thinking the computer is intelligent, but actual intelligence – bringing ‘whatever’ it is to the electronic universe that nature has granted the animal kingdom for so long. It is the holy grail of Computer Science, AI subfields, and Cognitive Science – attempted by many brilliant people, and ultimately accomplished by no one as of yet. After the work of Von Neumann, Turing, and the dawn of the programmable machine in the 1950s, there have been many theories on how to accomplish this task. They range from expert systems, drawing on large databases and extensive rules of logic to yield a result, to artificial neural networks that model their biological counterparts found in nature. The TFNN project chooses the method of the latter, this author believing that mother nature already has the design down pretty pat, there’s no need in reinventing the paradigmatic wheel, so to speak.

The most important piece, the software that creates a virtual neural network within a computer, took a little over half a decade for me to write, but it’s been done for a while now. The problem is, though I can test out the functionality of specific neurons and small circuits of neurons (Which work beautifully after A LOT of frustration), I can’t test out Hebbian Learning (Hebb’s ‘Fire Together Wire Together’ postulate, large basis of both intrinsic and extrinsic memory) across a large neural matrix (TFNN term for a neural nucleus, a ganglion, any local cluster of neurons). Without external stimulus and the ability to somehow manipulate the environment (no matter how small that manipulation be), it is impossible to study any meaningful organization across the neural matrices. A neural network’s ability to mold itself to the universe around it is dependent on meaningful and continuous sensory input. In other words, I have the brain, but of yet I had no body to test it out in.

Right now we’re working with this brilliant guy in Minnesota who received a grant through his university to build the prototype robot that will house a large scale implementation of TFNN. This is still a ways away though, and I’m kind of itching to get some testing and experimentation done on a smaller scale – building from 10,000 to 100,000 neurons, from 10,000 to a million synapses. At the school district I work at we do a lot of work with Lego robotics – and I realized this was the perfect opportunity – lego robots are a snap to build, have access to simple sensory inputs and are easily interfaced from a C++ environment.

So I introduce Milo! (I seem to name everything this, I’m not quite sure why. ;))

Milo is pretty quick and dirty, no gearing or manipulative appendages. BUT – that’s not very important since the test neural networks that he will run will start out as very rudimentary – more on that in a second.

What Milo does have is the ability to manipulate the motors in each front wheel, respectively, both power (speed) and direction (forward or backwards). Also, Milo has a forward and downward pointing light sensor – one detects ambient light while one scans the ground. Also, Milo has two large antennae in the front that are connected to touch sensors.

This entry is a little longer than I wanted, but a few things –

I need to rewrite some code involved with the emulation of neurotrophin release( for axon terminal growth and pruning neurons) – currently each presynaptic neuron assumes it received virtual neurotrophins from the post-synaptic neuron, regardless of if the post-synaptic neuron fired simultaneously or not. While this doesn’t affect specific neuron functionality, on a large scale it defeats the point of a neural network – unless a neuron receives no input it never dies (So no pruning, no selectivity), any looping (which is necessary) within the network leads to a cascade overload after a few minutes since every synaptic pathway is strengthening whenever it receives activity, after a few minutes every neuron is firing constantly and out of control – something akin to the computer going through the most massive seizure in history.

Besides that code rewrite, the rest is down to testing. The first incarnations of Milo’s brain will be single and dual matrix constructions. I will continue to add matrices as time goes on, in the final test case I plan on a thalamus for each of the sensory inputs connected via a neural bridge to both a rudimentary respective cortex and a proto-amygdala. It is my hope to see neural configurations and activity akin to that observed by Joseph LeDoux et al in their neural connectivity mapping of danger input to motor-control output.

Things I will be experimenting with in general in every matrix configuration – different threshold values and time periods associated with neuron firing. This is akin to adjusting how much glutamate and other neurotransmitters/modulators a neuron secretes. In the virtual neuron world it is a threshold number of pulses arriving in an arbitrary amount of time.

Also, adjusting how much to increase/degrade synaptic weight (application of virtual neurotrophins).

Eventually I hope to also incorporate tests that speak toward the Roger Penrose theory of quantum mechanics taking place within synaptic or neural activity. This isn’t as important right now though, especially since neural activity appears to be deterministic anyway, and I don’t believe in indeterminism in quantum mechanics anyway, so I think its a needless test. But being a good scientist I have to rule out all possibilities and not be biased by my own personal thoughts. ๐Ÿ˜‰

There’s also going to be an efficiency issue of the Temporal Frame engine with this new code I have to write to fix the Hebbian Plasticity problem I outlined above. The TFNN is already a little slow due to some stuff – this is going to slow it down a little (maybe lot) more. Good thing all these new smokin 64 bit processors are coming out. ๐Ÿ˜‰

Anyway, I had a lot to talk about in the beginning, outline what’s going on, I promise not all the entries will be as boring, long or confusing. I also hope for more pictures and diagrams! ๐Ÿ˜‰ Bye for now!