Skip to content

feat: Reset to zero for Leaky

Jerome Hue requested to merge jeromeh/aidge_core:leaky-reset into dev

Context

The goal of this MR is to add an option to select a soft reset (subtraction, eq.1 ) or a hard reset (reset to zero, eq. 2) when creating a Leaky Operator.

U[t+1] = βU[t] + I_{in}[t+1] - RU_{thr} \tag{1}

U[t+1] = βU[t] + I_{in}[t+1] - R(βU[t] + I_{in}[t+1]) \tag{2}

Note that for the implementation of hard reset, the potential is reset to zero in the next step, so if we have a spike at step s=0, then we start s=1 by setting the memory to zero, and proceed with computing the potential by taking the input.

Modified files

  • MetaOperatorDefs.hpp: Add a LeakyReset enum and change Leaky constructor;
  • Leaky.cpp : Use the additional LeakyReset constructor parameter to create the Leaky node;
  • pybind_MetaOperator.cpp: reflect the changes made to the constructor;
  • Test_MetaOperator.cpp: Test the instanciation of a Leaky node with reset to zero;

Note: More tests have alaredy been written in aidge_backend_cpu to assert that the behaviour is correct.

Related issue

Fix #219

Edited by Jerome Hue

Merge request reports

Loading