hxtorch.spiking.modules.iaf_neuron.IAFNeuron

class hxtorch.spiking.modules.iaf_neuron.IAFNeuron(size: int, experiment: Experiment, func: Union[Callable, torch.autograd.Function] = <function cuba_iaf_integration>, execution_instance: Optional[ExecutionInstance] = None, params: Union[NamedTuple, F.CUBAIAFParams] = CUBAIAFParams(tau_mem_inv=99999.99999999999, tau_syn_inv=99999.99999999999, tau_ref=tensor(0.), v_th=tensor(1.), v_reset=tensor(0.), alpha=50.0, method='superspike'), enable_spike_recording: bool = True, enable_cadc_recording: bool = True, enable_cadc_recording_placement_in_dram: bool = False, enable_madc_recording: bool = False, record_neuron_id: Optional[int] = None, placement_constraint: Optional[List[halco.LogicalNeuronOnDLS]] = None, trace_offset: Union[Dict[halco.AtomicNeuronOnDLS, float], torch.Tensor, float] = 0.0, trace_scale: Union[Dict[halco.AtomicNeuronOnDLS, float], torch.Tensor, float] = 1.0, cadc_time_shift: int = 1, shift_cadc_to_first: bool = False, interpolation_mode: str = 'linear', neuron_structure: Optional[Morphology] = None)

Bases: hxtorch.spiking.modules.neuron.Neuron

Integrate-and-fire neuron Caveat: For execution on hardware, this module can only be used in conjunction with a preceding Synapse module.

__init__(size: int, experiment: Experiment, func: Union[Callable, torch.autograd.Function] = <function cuba_iaf_integration>, execution_instance: Optional[ExecutionInstance] = None, params: Union[NamedTuple, F.CUBAIAFParams] = CUBAIAFParams(tau_mem_inv=99999.99999999999, tau_syn_inv=99999.99999999999, tau_ref=tensor(0.), v_th=tensor(1.), v_reset=tensor(0.), alpha=50.0, method='superspike'), enable_spike_recording: bool = True, enable_cadc_recording: bool = True, enable_cadc_recording_placement_in_dram: bool = False, enable_madc_recording: bool = False, record_neuron_id: Optional[int] = None, placement_constraint: Optional[List[halco.LogicalNeuronOnDLS]] = None, trace_offset: Union[Dict[halco.AtomicNeuronOnDLS, float], torch.Tensor, float] = 0.0, trace_scale: Union[Dict[halco.AtomicNeuronOnDLS, float], torch.Tensor, float] = 1.0, cadc_time_shift: int = 1, shift_cadc_to_first: bool = False, interpolation_mode: str = 'linear', neuron_structure: Optional[Morphology] = None)None

Initialize an IAFNeuron. This module creates a population of a non- leaking spiking neurons of size size. This module has a internal spiking mask, which allows to disable the event output and spike recordings of specific neurons within the layer. This is particularly useful for dropout.

Parameters
  • size – Size of the population.

  • experiment – Experiment to append layer to.

  • func – Callable function implementing the module’s forward functionality or a torch.autograd.Function implementing the module’s forward and backward operation. Defaults to LIF.

  • execution_instance – Execution instance to place to.

  • params – Neuron Parameters in case of mock neuron integration of for backward path. If func does have a param argument the params object will get injected automatically.

  • enable_spike_recording – Boolean flag to enable or disable spike recording. Note, this does not disable the event out put of neurons. The event output has to be disabled via mask.

  • enable_cadc_recording – Enables or disables parallel sampling of the populations membrane trace via the CADC. A maximum sample rate of 1.7us is possible.

  • enable_cadc_recording_placement_in_dram – Whether to place CADC recording data into DRAM (period ~6us) or SRAM (period ~2us).

  • enable_madc_recording – Enables or disables the recording of the neurons record_neuron_id membrane trace via the MADC. Only a single neuron can be recorded. This membrane traces is samples with a significant higher resolution as with the CADC.

  • record_neuron_id – The in-population neuron index of the neuron to be recorded with the MADC. This has only an effect when enable_madc_recording is enabled.

  • placement_constraint – An optional list of logical neurons defining where to place the module`s neurons on hardware.

  • trace_offset – The value by which the measured CADC traces are shifted before the scaling is applied. If this offset is given as float the same value is applied to all neuron traces in this population. One can also provide a torch tensor holding one offset for each individual neuron in this population. The corresponding tensor has to be of size size. Further, the offsets can be supplied in a dictionary where the keys are the hardware neuron coordinates and the values are the offsets, i.e. Dict[AtomicNeuronOnDLS, float]. The dictionary has to provide one coordinate for each hardware neuron represented by this population, but might also hold neuron coordinates that do not correspond to this layer. The layer-specific offsets are then picked and applied implicitly.

  • trace_scale – The value by which the measured CADC traces are scaled after the offset is applied. If this scale is given as float all neuron traces are scaled with the same value population. One can also provide a torch tensor holding one scale for each individual neuron in this population. The corresponding tensor has to be of size size. Further, the scales can be supplied in a dictionary where the keys are the hardware neuron coordinates and the values are the scales, i.e. Dict[AtomicNeuronOnDLS, float]. The dictionary has to provide one coordinate for each hardware neuron represented by this population, but might also hold neuron coordinates that do not correspond to this layer. The layer- specific scales are then picked and applied implicitly.

  • cadc_time_shift – An integer indicating by how many time steps the CADC values are shifted in time. A positive value shifts later CADC samples to earlier times and vice versa for a negative value.

  • shift_cadc_to_first – A boolean indicating that the first measured CADC value is used as an offset. Note, this disables the param trace_offset.

  • interpolation_mode – The method used to interpolate the measured CADC traces onto the given time grid.

  • neuron_structure – Structure of the neuron. If not supplied a single neuron circuit is used.

Methods

__init__(size, experiment[, func, …])

Initialize an IAFNeuron.

configure_hw_entity(neuron_id, neuron_block, …)

Disables the neurons leak to behave like a integrate-and-fire neuron.

Attributes

configure_hw_entity(neuron_id: int, neuron_block: pylola_vx_v3.NeuronBlock, coord: pyhalco_hicann_dls_vx_v3.LogicalNeuronOnDLS)pylola_vx_v3.NeuronBlock

Disables the neurons leak to behave like a integrate-and-fire neuron.

Parameters
  • neuron_id – In-population neuron index.

  • neuron_block – The neuron block hardware entity.

  • coord – Coordinate of neuron on hardware.

Returns

Configured neuron block.

output_type

alias of hxtorch.spiking.handle.NeuronHandle