
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/surrogate_grad_fns/plot_multigaussian.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_auto_examples_surrogate_grad_fns_plot_multigaussian.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_surrogate_grad_fns_plot_multigaussian.py:


=============
MultiGaussian
=============
:class:`~sinabs.activation.MultiGaussian` surrogate gradient.

.. GENERATED FROM PYTHON SOURCE LINES 7-19



.. image-sg:: /auto_examples/surrogate_grad_fns/images/sphx_glr_plot_multigaussian_001.png
   :alt: plot multigaussian
   :srcset: /auto_examples/surrogate_grad_fns/images/sphx_glr_plot_multigaussian_001.png
   :class: sphx-glr-single-img





.. code-block:: default


    import matplotlib.pyplot as plt
    import torch

    import sinabs.activation as sina

    x = torch.linspace(-2, 4, 500)
    plt.plot(x, sina.MultiGaussian()(v_mem=x, spike_threshold=1), label="MultiGaussian")
    plt.xlabel("Neuron membrane potential")
    plt.ylabel("Derivative")
    plt.legend()
    plt.show()


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  0.122 seconds)


.. _sphx_glr_download_auto_examples_surrogate_grad_fns_plot_multigaussian.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example


    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_multigaussian.py <plot_multigaussian.py>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_multigaussian.ipynb <plot_multigaussian.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
