Code Monkey home page Code Monkey logo

integrate_and_fire_model's Introduction

Integrate and Fire Neuron

The code in this repository simulates an Integrate-and-Fire neuron. A description of the model can be found in this blog post.

I used a basic Euler method for numerical integration, which might not be accurate for large time steps or fast dynamics. For a more accurate simulation, you might want to use a more sophisticated method like Runge-Kutta or use a library like Brian2 that is specifically designed for simulating spiking neural networks.

The code is implemented in an interactive Jupyter notebook and you can change the parameters of model using sliders. You can run the notebook in Google Colab or Binder by clicking on onf of the buttons below:

Open In Colab Binder

Or download the notebook from this repository and run it locally.

The code models a single Integrate-and-Fire neuron for different input currents $I(t)$. First, a the membrane potential $U(t)$ and corresponding spike times are calculated using the equation for a constant input current $I(t) = I_0$. You can interactively adjust the parameters of the model using the sliders, namely $I_0$, the resistance $R$, the capacity $C$, the firing threshold $theta§$ and the resting potential $U_\text{rest}$:

png

Second, a the membrane potential $U(t)$ and corresponding spike times are calculated using the equation for a time-variable input current $I(t)$. Here, you can additionally adjust the membrane time constant $\tau$:

png

Third, a the membrane potential $U(t)$ and corresponding spike times are calculated for two input constant currents $I_{0,1}$ and $I_{0,2}$:

png

Simulating input currents with different intensities and durations: png

Please feel free to use the code for your own projects. If you find a bug or have a suggestion for improvement, please open an issue or send me an email.

If you use the code in your own projects, please cite it using the citation information:

Musacchio (2023), The Integrate and Fire Model: A simple neuronal model, https://www.fabriziomusacchio.com/blog/2023-07-03-integrate_and_fire_model/

or

@misc{Musacchio2023,
  author = {Musacchio, Fabrizio},
  title = {The Integrate and Fire Model: A simple neuronal model},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://www.fabriziomusacchio.com/blog/2023-07-03-integrate-and-fire-model/}},
}

integrate_and_fire_model's People

Contributors

fabriziomusacchio avatar

Watchers

 avatar

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.