shikhargupta / spiking-neural-network Goto Github PK
View Code? Open in Web Editor NEWPure python implementation of SNN
License: Apache License 2.0
Pure python implementation of SNN
License: Apache License 2.0
/encoding
freq = interp(pot[l][m], [-1.069,2.781], [1,20])
/multi_layer
freq = math.ceil(0.102*pot[l][m] + 52.02)
freq1 = math.ceil(200/freq)
Hi:
I just started learning SNN. I want to know these numbers' meaning and formula that you use to calculate firing rate.
Yo, I'm new to coding and for some reason it says no module named numpy, and unused statement import, but there's also a lot of marked warnings. How do I get this to work? I'm using pyCharm idk if I should use something else.
#calculating firing rate proportional to the membrane potential
freq = interp(pot[l][m], [-1.069,2.781], [1,20])
#print(l,m,pot[l][m], freq)
# print freq
Could anyone please elaborate more about the spike_train.py and recep_field.py code. I could not get it properly .
hey man, I am running your code rescently. It's a wonderful work. However, I met a question and I need your help.
When i run the classify.py in classification file, i found the error "from receptive_field import rf" was wrong. I check up the receptive_field file, there is not a "rf" in there. So where is "rf" in receptive_field?
Looking forward to your reply.
how do I input a bigger size image?
I get an error when I put bigger size image :
IndexError Traceback (most recent call last)
in
27 for n in ran:
28 if (i+m)>=0 and (i+m)<=255 and (j+n)>=0 and (j+n)<=255:
---> 29 summ = summ + w[ox+m][oy+n]*img[i+m][j+n]
30 pot[i][j] = summ
31
IndexError: index 217 is out of bounds for axis 0 with size 217
Why are you calculating threshold image-wise? isn't that analogous to changing the excitatory neurons for every image?. Homoeostasis does speak of variable threshold but that's only updated after a neuron spikes. Please correct me if I am wrong.
Referring to: https://dl.acm.org/citation.cfm?id=3266229
Hi,
My code launches an error due to the class neuron haven't got Pth attribute. Is the class incomplete?
Thanks in advance
IndexError Traceback (most recent call last)
in ()
52
53 #Convolving image with receptive field
---> 54 pot = rf(img)
55
56 #Generating spike train
# C:\Users\pc\AnacondaProjects\Spiking-Neural-Network-master\training\recep_field.py in rf(inp)
35 for n in ran:
36 if (i+m)>=0 and (i+m)<=par.pixel_x-1 and (j+n)>=0 and (j+n)<=par.pixel_x-1:
---> 37 summ = summ + w[ox+m][oy+n]*inp[i+m][j+n]/255
38 pot[i][j] = summ
39 return pot
IndexError: index 16 is out of bounds for axis 0 with size 16
this happens when i change the image from 1.png to 100.png or 101.png given below to
for k in range(par.epoch):
for i in range(322,323):
print (i," ",k)
img = cv2.imread("images/100.png", 0)
I noticed that in the demo program, there is only one picture of one class. Once I put more pictures in the training_image folder, it can't training properly. Is there anything wrong with my operation or is it the limitation of this program?
Question:for j, x in enumerate(layer2):
active = []
if(x.t_rest<t):
x.P = x.P + np.dot(synapse[j], train[:,t])
if(x.P>par.Prest):
x.P -= par.D
active_pot[j] = x.P
Dear researcher, bother you!
For the above intercepted code, I have a doubt and would like to communicate with you.
For xP-= par.D . I still can't figure out the meaning of subtracting par.D. I checked the value of par.D, which is 0.75 in your document, and I looked up the relevant information, and I still don't know this clearly meaning.
At your convenience, would you please help me explain this problem?My email is [email protected]. Thank you very much and look forward to hearing from you!
In the convolution part of the code the boundary for the window needs to be made 27 and not 15.
#Convolution
for i in range(28):
for j in range(28):
summ = 0
for m in ran:
for n in ran:
if (i+m)>=0 and (i+m)<=27 and (j+n)>=0 and (j+n)<=27:
summ = summ + w[ox+m][oy+n]*inp[i+m][j+n]/255
pot[i][j] = summ
return pot
Spiking-Neural-Network/multi_layer/spike_train.py
Lines 33 to 35 in de3e24d
this error is undefined, maybe a str "error" or something else is OK.
Please could you add ReadMe for the classifier: https://github.com/Shikhargupta/Spiking-Neural-Network/tree/master/classification?
ImportError Traceback (most recent call last)
in ()
5 import cv2
6 from spike_train import encode
----> 7 from reconstruct import reconst
8 from weight_initialization import learned_weights_x
9 from weight_initialization import learned_weights_o
ImportError: cannot import name 'reconst'
I have a different classification results for each training.(I made n = 10 to recognize digits)
here are two different training results
322 0
winner is 2
322 1
winner is 2
322 2
winner is 2
322 3
winner is 2
322 4
winner is 2
322 5
winner is 2
322 6
winner is 2
322 7
winner is 2
322 8
winner is 2
322 9
winner is 2
322 0
winner is 4
322 1
winner is 4
322 2
winner is 4
322 3
winner is 4
322 4
winner is 4
322 5
winner is 4
322 6
winner is 4
322 7
winner is 4
322 8
winner is 4
322 9
winner is 4
how can i use these spikes count in python that can classify images
hi,I would like to ask, is your network unsupervised learning?
how to find the accuracy of classification results
I'm new to python.
I'm getting this error when I run classify.py
TypeError Traceback (most recent call last)
in
29 # creating the hidden layer of neurons
30 for i in range(n):
---> 31 neuron(a)
32 layer2.append(a)
33
TypeError: 'module' object is not callable
please help me solve this error
would you please give me the link of reference paper?
Hello @Shikhargupta ,
Thank you for the great README about the Spiking Neural Network functioning, but I don't really understand the structure of the repository. For example, I don't get why there are many different "neuron.py", spike_train.py", "recep_field.py", ecc... files in different folders and if they are all necessary.
Is it also possible to run the code out of the box?
Thank you very much,
Gianluca
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.