Skip to content

Draft: Set LeakyOp output order based on output flag

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

Context

The Aidge::Sequential helper graph view builder automatically select the first output of a node and try to connect it to the following node in the given list.

However, for Leaky nodes, we have two main outputs : the tensor of spikes, and the tensor of potential. For non output nodes, we just want to transmit the spikes. For output nodes, there are different ways to compute the loss, we could use either spikes or potential.

This MR change which output is ordered at the first output, based on the output flag of Leaky ctor. (Thus it should be renamed at some point).

If a leaky node is not an output, we set the first (#0) output to be spikes. If it is, we set the first output to be the potential. This way :

Aidge::Sequential([
  FC,
  Leaky(output=false),
  FC,
  Leaky(output=true),
  Stack
])

Correctly chain the nodes, stack will stack the potential.

Fix #309 (moved)

Merge request reports

Loading