GithubHelp home page GithubHelp logo

Comments (6)

 avatar commented on May 15, 2024 1

Since there is a definition of t in network/init, one possible way is to add t as an additional argument to step function. Inside the step function, introduce new variable to store spiking time (say t_spike). Everytime step function is called, check if t-t_spike is greater than refractory period and do operation accordingly.

from bindsnet.

djsaunde avatar djsaunde commented on May 15, 2024

Good point. How would you fix this? Feel free to open a PR.

from bindsnet.

djsaunde avatar djsaunde commented on May 15, 2024

Hm, that could be problematic when doing multiple simulations in sequence. For example:

network.run(inpts, time=100)
network.run(inpts, time=100)  # Forgets refractory neurons from end of previous simulation!

Alternatively, one could just reverse the ordering, from:

# Decrement refractory counters.
self.refrac_count[self.refrac_count != 0] -= dt 

# Integrate inputs. 
self.v += (self.refrac_count == 0).float() * inpts 
  
# Check for spiking neurons.
self.s = self.v >= self.thresh

# Refractoriness and voltage reset. 
self.refrac_count.masked_fill_(self.s, self.refrac) 

to

# Integrate inputs. 
self.v += (self.refrac_count == 0).float() * inpts 
  
# Decrement refractory counters.
self.refrac_count[self.refrac_count != 0] -= dt 

# Check for spiking neurons.
self.s = self.v >= self.thresh

# Refractoriness and voltage reset. 
self.refrac_count.masked_fill_(self.s, self.refrac) 

Does this make sense? Does this appear to solve the problem?

from bindsnet.

 avatar commented on May 15, 2024

Yes, that will be better than my solution.

from bindsnet.

 avatar commented on May 15, 2024

You may need to be careful when changing order. There are models (like this) that do self.refrac_count == 0 more than once.

from bindsnet.

djsaunde avatar djsaunde commented on May 15, 2024

Solved by #136.

from bindsnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.