Video yükleniyor...
Video Yüklenemedi
I built a biologically inspired spiking neural network from scratch and it learned with %5 accuracy to do addition :) There is no backpropagation, no artificial loss functions - just spikes, synapses, and dopamine-like reward signals. it uses STDP -> "Spike-Timing-Dependent Plasticity" with modulated rewards This is super fun... show more
447,978 görüntüleme • 11 ay önce •via X (Twitter)
87 Yorum

Spiking neural network from scratch source code:

I dont want to discourage you but if it's just single digit addition then the model could just return 9 every time and achieve 10% accuracy

Yeah, I thought if the same thing but for a long time it was stuck only at 0% so I was happy to achieve even just what would amount to luck :) Although I think it is learning, as little later in the training it again collapses to 0%

Running a genetic hyper parameter optimization on top of it. it looks promising so far

5% accuracy 😂 Better than trying to win the lottery 🤷

It is pretty low accuracy. But these things are hard :) Learning about them is the real win. There are torch extension python libraries which I will explore too.

wasn't a diss on you if that's how it came across, just poking fun at the neural network :) when I set up my first nn training (c++) program (with backprop) I wanted to see if it could learn addition from a few example. It did from a few examples, but up to 10 🙃 I'd say what you're doing is more interesting, and by far prettier.

I didn’t take it that way at all :)

Did it a little different, but on a similar path.

Pretty cool!

omg you actually did it

Thank you but it doesn’t really learn that well yet :)

@CdotRomano I don’t think this was meant as a compliment…

@hive_echo it was! my article jokes that NN/addition is a boring idea, but here echo hive has cleverly found an interesting approach to it, making me look a fool.

@hive_echo In that case I am the fool as well, because I can't tell whether you guys are serious or joking!

@CdotRomano 🙂

Here is the updated versions with genetic hyper parameter optimization which achieves %8 accuracy

Nice UI. What is it written in?

Thank you. In python with numpy

... What? Did you write your own text raster to numpy arrays or something?

Numbers are represented by population coding as arrays like this All elements shown at once and not sequentially

Just reverse it for 95% accuracy

😆

Here is another biology inspired navigation system, continuous attractor network with motor neurons learns to navigate using reward-modulated hebbian plasticity:

I built a couple of these. What do you mean by no back propagation, I understand in the traditional sense it’s not the same, but you still need to update the weights that control the firing

I am a bit vague on this but there is a reward mechanism (dopamine) which strengthens connections when correct answer is fired. It is more similar to RL in that sense. There is no signal that goes back and no gradient descent etc

@jasonadrury You need to check which connections fire at the same or in closest timeframe. You can strengthen or weaken these connections locally or globally or even backtrack through them, just use time as the path to backtrack when an output fires.

@jasonadrury It is doing this via spoke timing dependency. If a then b then strengthen. If b before a then weaken

@jasonadrury Can it do loops?

@jasonadrury Not sure if I understand

@jasonadrury Can the connections form a circle instead of only being only one directional?

@jasonadrury I believe they could, take a look at hopfield and continuous attractor networks

5 percent accuracy is. well its a start. Doing STDP without backprop is choosing the hardest difficulty setting. Mad respect for even trying it.

@productpilotbb Thank you. Appreciate it. I made some improvements and got it to 10% I think. Will tune the hyper Params now and see where it goes. But it seems this is the limits of the current setup without changing it in a big way.

Would a sufficiently smart and large spiking network rediscover & store backprop weights? Considering backprop is just regular matrices in most frameworks

I am not sure if backprop weights would be important for spiking networks They see important in regular NNs because they all add up to a number perhaps But in SNN spike timing etc are more important and weights only serve a purpose to let different neurons better connect with others. I don’t think they are used like an accumulating number so to speak

I played with SNNs and R-STPD. I couldn’t beat backprop. It’s brutally effective. I did get a ‘spectral’ SNN and R-STPD running in the frequency domain with FFTs which was faster than a naive SNN implementation. No faster than a reasonable truncation though.

I am also realizing that they are very difficult but it is a learning experience for me and a fun exploration :)

exactly - ai needs the right environments (complex, survivable, incentivised) - then I believe it can start with a single dividing cell and learn all it needs

Perhaps. We don’t know the exact mechanisms but exploring is fun. In theory it should just learn on its own and evolve etc as you said

Here is another bio inspired network which learns to avoid obstacles and guide itself toward food

That's so pretty! What did you use to visualize?

Thank you. I used pygame

If genetic algorithms and learning interest you, check out Creatures:

Smart

Thank you

Am missing something here? What's the point of getting 5% accuracy for single digit addition? What am i missing?

It is an experiment I did

I am not bothered per se but it is not very good at all. It is fun for me because my goal is to learn how all this stuff works

Cool! I created also a SNN with not only STDP but a lot more. Was missing a visualization and might look at yours. My agent learned to find food (rewarded with dopamine) and did unit test where I poisened my neurons (like drunk) - some fun experiments

Very cool. I want to do navigation experiments too

That’s how real intelligence starts — elegant chaos turning into math.

Well said!

💕

This is the future!!

I hope spiking neural nets won’t just remain an under explored area of AI research

extremely based. i wrote a recurrent NN based on STDP. had trouble with it getting stuck in a weird state and sending parameters to -inf or +inf

They are not easy to train so far, that is for sure :)

so very cool!

Thank you!

Kind of always felt the need of approaching ANNs from a more computational neuroscience POV. Feels like those are areas that should very naturally interact between themselves but afaik there's little work on that.

I agree with you and that makes it more fun and rewarding to experiment with these ideas IMO

yup, totally. very very interesting works, btw. don't totally understand the architecture you're using (I've thought about something mixing a hopfield network with a self-organizing map + spiking NNs at some point, and one thing which occurred to me seeing this work is //

considering to take into account the variety of neurotransmitters there are. Dopamine seems like the best one to start with; but I'd very much like to see what happens if we were to introduce some other NTs. I feel the most natural ones to follow would be GABA and Glutamate.

(ever tried something similar?)

You and I have very similar thoughts and ideas on this. I do want to explore some kind of hopfield like memory or otherwise, along with multiple neurotransmitter analogs but I also want to get back to basics and understand some fundamental things better instead of keep adding things on top you know :)

Yes :) I'd say 'learning advanced math & physics just because' already resonates strongly with my profile as a researcher XD my gh if appropriate Nothing fancy there, but some stuff might provide some insights, idk

like, cellular automata on graphs with feedbackish interactions bt topology n dynamics -- which I thought to be a first step towards what I called at that time 'SSNNs', similarity spiking neural networks

Love the concept, but it looks like you have ~20 outputs which makes 5% success rate equal to random.

i actually got it to 7-8% also it starts at lower than 5% and works it way up then sometimes collapse to below 5% all of which leads me to believe there is glimmers of learning taking place

Try it on markov chains……

It had been on my mind to explore markov chains

Dopamine kick addicted AIs, that's the machines we want now? :D Amazing work, though!

Thank you 😊

Very cool, great work!

Thank you!

I'm picturing the network trying to learn and totally bombing, just like real life! That 5% accuracy is totally me in elementary school with math!

🙂

Where does one learn about this stuff

Just search for spiking neural networks. You will find a lot of info about it both from neuroscience perspective and machine learning perspective

Looks so damn cool! Btw what are the use cases of these

Thank you As far as I know there aren’t any or many use cases as they don’t work well or are not as scalable. But if someone were to get them working right then their use case could be everything :) This is more close to how brains actually learn

Okk. Cool project. What is the tech stack used for it?

Whoa, that's seriously cool! 🤯 Learning addition with just spikes and rewards is wild. Can't wait to see that accuracy climb!

omggggg this has been on my weekend side project list for about 6 weeks, so sick!!

Thank you. You should do it!

startup lyfe - I'm pretty sure with the right amount of effort, people can build decent companies around SNN's
