#OneShot - A Spiking Neural Network

19 messages · Page 1 of 1 (latest)

agile pebble
#

This is a self-regulating Spiking Neural Network I'm building that uses time, spike, and neuromodulatory based plasticity. It's designed to change its own synaptic structure based on learning rules similar to those in the human brain. The simulation currently runs with about 26k neurons.

The environment is a simple 2D world with colored circles. Red is poison, green is food, and blue is water. A large static ball in the center signals the agent's state: white means it's hungry, black means it's thirsty. The agent must learn to walk, to follow the correct ball based on the central signal, to avoid the red poison balls, and to predict the movement of the moving objects.

The agent's "brain" processes vision from sensory rays through a cortical model using predictive coding. A basal ganglia circuit then selects the appropriate action by disinhibiting motor neurons, whose spikes generate movement. Learning is driven by a reinforcement rule called R-STDP. The model also has a hippocampus for spatial planning and a sleep phase for memory consolidation.

Known limitations are unpredictable learning and very slow performance; with 20k neurons it runs at 0.002x real-world speed. There is also a recurring issue where synaptic weights in the motor system grow too strong over time, causing the agent to move too fast and lose delicate control.

My current work is focused on making the code more modular, improving documentation for maintainability, and optimizing performance through better memory access and SIMD. I am also trying to improve the model's learning quality to fix the movement sensitivity.

agile pebble
#

I may rewrite the task to make the model play chess

agile pebble
#

Cuda is pretty fast. I'm in the process of moving some hot and parallized loops to the gpu using cuda. I could use compute shaders but their too verbose, carry some overhead and I think I have to use textures and things like that to represent data which is a bit slow (encoding and decoding)

agile pebble
#

I am able to simulate 100k neurons now.

#

I'm still looking for optimizations.

agile pebble
#

I finally got 100% accuracy!!

After training the SNN for almost 10k images I consistently get 98%-100% accuracy on the last 50 processed images!

long solstice
#

That's awesome dude

#

Congrats

#

Hard work paying off

tidal abyss
#

Can't wait to see a full human brain simulated lol

agile pebble
#

me neither

long solstice
#

I have a project that is based on spiking neural networks that I'll share in a separate thread in a few days once I get some more progress done and a visualizer for the firing of the neurons

#

I think you'll really like it

agile pebble
#

ping me when you create the thread

long solstice
#

just an update before I get the evolutionary set up on it in the next few days: the reward/punishment system does seem to work, and it has (in my very simple training sim) meta-learned about the system rather than do what I wanted it to lmao

#

the setup is simple. the network controls the movement of a cell in a space and if it interacts with a circle of radius R, it gets a reward, being punished for not getting a hit every 5k ticks. however, in testing, I tried out randomly relocating the cell whenever a reward/punish signal is sent, so it has learned that by randomly moving around when it detects its position has changed massively, it is more likely to accidentally bump into the target, and if it doesn't within a few ticks, it stops moving entirely, until it's punished and relocated.

#

which is honestly really cool that it's managed to learn behavior across multiple success signal cycles like that

#

the intended behavior is to seek out the target (which is obviously huge but I am being very, very lenient with it), but I'm happy that to some degree the system is working as mostly intended