Skip to content
Snippets Groups Projects

feat: Reset to zero for Leaky

Merged Jerome Hue requested to merge jeromeh/aidge_core:leaky-reset into dev
1 unresolved thread

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]+Iin[t+1]RUthr(1) U[t+1] = βU[t] + I_{in}[t+1] - RU_{thr} \tag{1}

U[t+1]=βU[t]+Iin[t+1]R(βU[t]+Iin[t+1])(2) 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=0s=0
, then we start
s=1s=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

Code Quality is loading
Test summary results are being parsed

Merged by Jerome HueJerome Hue 1 month ago (Feb 27, 2025 2:12pm UTC)

Loading

Pipeline #66663 passed

Pipeline passed for f0e41abc on dev

Test coverage 51.35% (0.05%) from 2 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading