sinabs.SynOpCounter

SynOpCounter

class SynOpCounter(modules, sum_activations=True)

Counter for the synaptic operations emitted by all Neuromorphic ReLUs in a model.

Usage:

counter = SynOpCounter(MyTorchModel.modules(), sum_activations=True) output = MyTorchModule(input) # forward pass synop_count = counter()

Parameters
  • modules – list of modules, e.g. MyTorchModel.modules()

  • sum_activations – If True (default), returns a single number of synops, otherwise a list of layer synops.