:py:mod:`snnmetrics.synops`
===========================

.. py:module:: snnmetrics.synops


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   snnmetrics.synops.SynOps




.. py:class:: SynOps(fanout: Union[float, torch.Tensor], sample_time: Optional[float] = None)

   Bases: :py:obj:`torchmetrics.metric.Metric`

   A metric that calculates the number of synaptic operations, both for every neuron in the
   layer and for the sum over all neurons in the layer. The number of synaptic operations is
   defined as number of spikes times the fanout, which are the number of connections each neuron
   has to the next layer. Whereas the fanout using fully-connected connectivity is equal to the
   number of neurons (or features) in the next layer, the situation for convolutional layers is
   more complex. Parameters such as stride, kernel size, grouping and others all have influence on
   convolutional fanout. When you think about a convolutional kernel that is applied to every
   receptive field, the neurons at the edge of the input will be seen less often (given a padding
   of zero) than neurons in the middle. The convolutional fanout can be approximated when the
   spatial input size is large enough.

   :param fanout: Can either be a float or a tensor of shape (C,H,W).

   .. py:attribute:: is_differentiable
      :type: bool
      :value: True

      

   .. py:attribute:: higher_is_better
      :type: Optional[bool]

      

   .. py:attribute:: full_state_update
      :type: bool
      :value: False

      

   .. py:method:: update(output: torch.Tensor)

      Override this method to update the state variables of your metric class.


   .. py:method:: compute()

      Override this method to compute the final metric value from state variables synchronized across the
      distributed backend.



