leaflabs / WaspNet.jl

GNU General Public License v2.0
13 stars 6 forks source link

Add Poisson Spike Train neuron #12

Closed GuillaumeLam closed 2 years ago

GuillaumeLam commented 3 years ago

Base neuron which given a probability, p, fires at each time step.

SBuercklin commented 3 years ago

Is p a function of inputs, or is it fixed for the neuron? If p is a function of inputs, what is the method for mapping the incoming signals to the probability p?

Do you think you could try mocking up the neuron type? The LIF example here is pretty minimal and shows off what goes into defining a new neuron. You can also extend this by adding your own <:AbstractNeuron types and providing the analogous methods from the LIF neuron.

GuillaumeLam commented 3 years ago

Given an array of values, I would need to normalize the array to turn each value into a probability. Then the neuron would fire into the network with prob p. I initially added a new type of neuron but realized a much cleaner way with an additional util function that acts as the input to the network. I have this small addition on my local forked version of the library. Should I make a pull request?

SBuercklin commented 3 years ago

Sure, submit a PR and I'll take a look. If you can write some tests to verify the correctness of the model, that'd be appreciated. Otherwise, I'm happy to get a wider collection of neuron models available for use.

GuillaumeLam commented 3 years ago

Submitted a PR! I also have some tests. They aren't exhaustive but the method in itself is not very complicated.