leaflabs / WaspNet.jl

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

Problem running the docs example #21

Open DanielParraUnam opened 2 years ago

DanielParraUnam commented 2 years ago

Hello,

I am a grad student very interested in implementing different STDP rules for DL image tasks. I just started and am having trouble running the docs example, in particular simulate! doesnt alter the state and the following line

LIFsim = simulate!(neuronLIF, (t)->0.4*exp(-4t), 0.001, 0.250, track_state=true)

simulates an static neuron for all the parameters I tried. I was wondering if someone could help me get started either debugging the docs example or with a working example of STDP

Thank you for your time! Daniel,

P.D: tried it on Julia 1.4.2 and 1.6.2 in windows 10 (also there is a bug in the reset function, 0 should be a float64 0. )

SBuercklin commented 2 years ago

If you construct a Network with one Layer with one neuronLIF in it, does that work? It's possible that specifically the simulate!(::AbstractNeuron, ...) case is broken

SBuercklin commented 2 years ago

This works for me:

using WaspNet

lif = WaspNet.LIF()
l = Layer([lif], reshape([1.0], 1, 1))
net = Network([l])

LIFsim = simulate!(net, (t)->0.4*exp(-4t), 0.001, 0.250, track_state=true)

We could (probably should) add a method which generates this automatically if an AbstractNeuron is the object to be simulated