hxtorch.spiking.modules.input_neuron.InputNeuron

class hxtorch.spiking.modules.input_neuron.InputNeuron(*args, **kwargs)

Bases: hxtorch.spiking.modules.types.population.InputPopulation

Spike source generating spikes at the times given in the dense spike_times array binned with the time step of the experiment.

__init__(*args, **kwargs)

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Methods

__init__(*args, **kwargs)

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward_func(input[, hw_data])

get_spike_times()

post_process(hw_data, runtime)

This methods needs to be overridden for every derived module that demands hardware observables and is intended to translated hardware- affine datatypes returned by grenade into PyTorch tensors.

Attributes

changed_input_data

property changed_input_data
forward_func(input: types.Handle_current_membrane_cadc_membrane_madc_spikes, hw_data: Optional[Tuple[torch.Tensor], None] = None)types.Handle_current_membrane_cadc_membrane_madc_spikes
get_spike_times()
output_type

alias of types.Handle_current_membrane_cadc_membrane_madc_spikes

post_process(hw_data: HXTorchObservables, runtime: float)Tuple[Optional[torch.Tensor], ]

This methods needs to be overridden for every derived module that demands hardware observables and is intended to translated hardware- affine datatypes returned by grenade into PyTorch tensors.

Parameters
  • hw_data – A HardwareObservables instance holding the hardware data assigned to this module.

  • runtime – The requested runtime of the experiment on hardware in us.

  • dt – The expected temporal resolution in hxtorch.

Returns

Hardware data represented as torch.Tensors. Note that torch.Tensors are required here to enable gradient flow.