{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# *(Teka, et. al, 2018)*: Fractional-order Izhikevich neuron model\n", "\n", "[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/brainpy/examples/blob/main/neurons/2018_Fractional_Izhikevich_model.ipynb)\n", "[![Open in Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://github.com/brainpy/examples/blob/main/neurons/2018_Fractional_Izhikevich_model.ipynbb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Implementation of the model:\n", "\n", "- Teka, Wondimu W., Ranjit Kumar Upadhyay, and Argha Mondal. \"Spiking and bursting patterns of fractional-order Izhikevich model.\" Communications in Nonlinear Science and Numerical Simulation 56 (2018): 161-176." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import brainpy as bp\n", "\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def run_model(dt=0.1, duration=500, alpha=1.0):\n", " inputs, length = bp.inputs.section_input([0, 10], [50, duration],\n", " dt=dt, return_length=True)\n", " neuron = bp.neurons.FractionalIzhikevich(1, num_memory=int(length / dt), alpha=alpha)\n", " runner = bp.DSRunner(neuron,\n", " monitors=['V'],\n", " inputs=['input', inputs, 'iter'],\n", " dt=dt)\n", " runner.run(length)\n", "\n", " plt.plot(runner.mon.ts, runner.mon.V.flatten())\n", " plt.xlabel('Time [ms]')\n", " plt.ylabel('Potential [mV]')\n", " plt.title(r'$\\alpha$=' + str(alpha))\n", " plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Regular spiking" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING:jax._src.lib.xla_bridge:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "87daf011594b4222ab3093796f8ec17d", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/5500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=500, alpha=1.0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Intrinsically bursting" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6e6f6c9d824047b7b7ee45f92c2dda0b", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/5500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=500, alpha=0.87)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Mixed Mode (Irregular)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5d2604a07c3446a393bf9f551e7d4bbf", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/5500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=500, alpha=0.86)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Chattering" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d9e096f715c74ce791f2c109a9054344", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/5500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=500, alpha=0.8)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Bursting" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f9ccd3cadacb4e0ab42d17f929e5b414", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/10500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=1000, alpha=0.7)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Bursting with longer bursts" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b43fce847af949bba334b8669cbb69ce", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/10500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=1000, alpha=0.5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Fast spiking" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9a6b8ee70627409aacfbdbaa49c5e8f8", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/10500 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "run_model(dt=0.1, duration=1000, alpha=0.3)" ] } ], "metadata": { "kernelspec": { "display_name": "brainpy", "language": "python", "name": "brainpy" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 1 }