Layer#

Submodules#

conex.behaviors.layer.dataset module#

class conex.behaviors.layer.dataset.SpikeNdDataset(dataloader, instance_duration, *args, ndim_sensory=2, ndim_location=2, have_location=False, have_sensory=True, have_label=True, silent_interval=0, loop=True, **kwargs)[source]#

Bases: Behavior

This behavior ease loading dataset as spikes for InputLayer.

Parameters:
  • dataloader (Dataloader) – A pytorch dataloader kind returning up to a triole of (sensory, location, label).

  • ndim_sensory (int) – Sensory’s number of dimension refering to a single instance.

  • ndim_location (int) – Location’s number of dimension refering to a single instance.

  • have_location (bool) – Whether dataloader returns location input.

  • have_sensory (bool) – Whether dataloader returns sensory input.

  • have_label (bool) – Whether dataloader returns label of input.

  • silent_interval (int) – The interval of silent activity between two different input.

  • instance_duration (int) – The duration of each instance of input with same target value.

  • loop (bool) – If True, dataloader repeats.

initialize(layer)[source]#

Sets the variables of the object. This method is called by the Network class when the object is added to the network.

Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.

Parameters:

object (TaggableObject) – Object possessing the behavior.

forward(layer)[source]#

Forward pass of the behavior. This method is called by the Network class per simulation iteration.

Parameters:

object (TaggableObject) – Object possessing the behavior.

training: bool#