{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Integrate and Fire (IAF)\n:class:`~sinabs.layers.IAF` layer.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from utils import plot_evolution\nimport sinabs.layers as sl\nimport torch\n\n\nconst_current = torch.ones((1, 100, 1)) * 0.03\nsingle_current = torch.zeros((1, 100, 1))\nsingle_current[:, 0] = 0.1\n\niaf_neuron = sl.IAF(record_states=True)\nplot_evolution(iaf_neuron, const_current)\n\n\niaf_neuron = sl.IAF(tau_syn=15.0, record_states=True)\nplot_evolution(iaf_neuron, single_current)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "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.7.9"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}