
.. 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_gaussian.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_gaussian.py>`
        to download the full example code

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

.. _sphx_glr_auto_examples_surrogate_grad_fns_plot_gaussian.py:


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

.. GENERATED FROM PYTHON SOURCE LINES 7-19



.. image-sg:: /auto_examples/surrogate_grad_fns/images/sphx_glr_plot_gaussian_001.png
   :alt: plot gaussian
   :srcset: /auto_examples/surrogate_grad_fns/images/sphx_glr_plot_gaussian_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.Gaussian()(v_mem=x, spike_threshold=1.0), label="Gaussian")
    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.134 seconds)


.. _sphx_glr_download_auto_examples_surrogate_grad_fns_plot_gaussian.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_gaussian.py <plot_gaussian.py>`

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

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


.. only:: html

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

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