jaxsnn.event.modules.hx.linear.Population

class jaxsnn.event.modules.hx.linear.Population(layer_idx: int, n_events: int, n_hw_spikes: Optional[int, None], *args, time_offset: float, **kwargs)

Bases: hxtorch.core.modules.population.Population, jaxsnn.event.hardware.modules.base_module.BaseModule

Base class for all populations

__init__(layer_idx: int, n_events: int, n_hw_spikes: Optional[int, None], *args, time_offset: float, **kwargs)

Initialize a Population. This module creates a population of neurons of size size. It includes an internal spiking mask, which allows disabling the event output and spike recordings of specific neurons within the layer. This is particularly useful for dropout.

The neuron is parameterized by the ModuleParameterType parameters:

leak, reset, threshold, tau_syn, tau_mem, i_synin_gm, membrane_capacitance, refractory_time, synapse_dac_bias, holdoff_time, exponential_slope, exponential_threshold, a, b, tau_adap.

More information about these parameters on BSS-2 can be found in calix.spiking.neuron.NeuronCalibTarget. If the parameters are not provided as ParameterType, they are implicitly converted to HXParameter, which ensures the same value is used for the BSS-2 calibration (param.hardware_value) and the numerical model (param.model_value) defined in forward_func. MixedHXModelParameter and HXTransformedModelParameter allow using different values on BSS-2 and in the numerical model. This is useful when the dynamic range on hardware and in the numerical model differ. In such cases, the trace and weight scaling parameters need to be set accordingly to translate the weights to their corresponding hardware value and the hardware measurements into the dynamic range used in the numerics.

Parameters
  • size – Size of the population.

  • experiment – Experiment to append the layer to.

  • leak – The leak potential. Defaults to HXParameter(80).

  • reset – The reset potential. Defaults to HXParameter(80).

  • threshold – The threshold potential. Defaults to HXParameter(125).

  • tau_mem – The membrane time constant in seconds. Defaults to HXParameter(10e-6).

  • tau_syn – The synaptic time constant in seconds. Defaults to HXParameter(10e-6).

  • i_synin_gm – A hardware parameter adjusting the neuron-specific synaptic efficacy. Defaults to HXParameter(500).

  • membrane_capacitance – The capacitance of the membrane. The available range is 0 to approximately 2.2 pF, represented as 0 to 63 LSB.

  • refractory_time – The refractory time constant in seconds. Defaults to HXParameter(1e-6).

  • synapse_dac_bias – Synapse DAC bias current. Can be lowered to reduce the amplitude of a spike at the input of the synaptic input OTA. This can help avoid saturation when using larger synaptic time constants. Defaults to HXParameter(600).

  • holdoff_time – Target length of the holdoff period in seconds. The holdoff period is the time at the end of the refractory period during which the clamping to the reset voltage is already released but new spikes cannot yet be generated. Defaults to HXParameter(0e-6).

  • exponential_slope – The exponential slope. Defaults to HxParameter(50e-3).

  • exponential_threshold – The exponential threshold. Defaults to HxParameter(110).

  • subthreshold_adaptation_strength – The subthreshold adaptation strength. Defaults to HxParameter(1).

  • spike_triggered_adaptation_increment – The spike-triggered adaptation offset. Defaults to HxParameter(1).

  • clock_scale_adaptation_pulse – This parameter controls the duration of the current pulse on hardware, that flows onto the capacitance of the adaptation. The set duration equals 2^(clock_scale_adaptation_pulse + 1) / 250e6 seconds. The magnitude of the spike-triggered adaptation increment on hardware corresponds to the product of this duration and the hardware-value set for spike_triggered_adaptation_increment. This value can be set per hemisphere individually. Defaults to (5, 5).

  • tau_adap – The adaptation time constant in s. Defaults to HxParameter(100e-6).

  • leak_adaptation – A value for the leak potential of the membrane, which is taken into account by the subthreshold adaptation mechanism on hardware. It may distinguish from the setting of the actual leak potential. If value is None, the value of the actual leak potential is taken. Only applicable on hardware, not in simulation.

  • chip_coordinate – Chip coordinate this module is placed on.

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

  • enable_cadc_recording – Enables or disables parallel sampling of the population’s membrane trace via the CADC. A maximum sample rate of 1.7 µs is possible.

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

  • enable_madc_recording – Enables or disables the recording of the membrane trace of the neuron specified by record_neuron_id via the MADC. Only a single neuron can be recorded. This membrane trace is sampled with significantly higher resolution than with the CADC.

  • enable_constant_current – Flag for enabling a constant on the neuron.

  • current_type – Type of the current either source or sink. Defaults to source.

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

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

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

  • leaky – Flag for enabling / disabling the leak term.

  • fire – Flag for enabling / disabling the firing behaviour.

  • exponential – Flag for enabling / disabling the exponential term.

  • subthreshold_adaptation – Flag for enabling / disabling the subthreshold adaptation term.

  • spike_triggered_adaptation – Flag for enabling / disabling the spike-triggered adaptation.

Methods

__init__(layer_idx, n_events, n_hw_spikes, …)

Initialize a Population.

Attributes

expected_return_type

Returns the expected return type of the neuron.

property expected_return_type

Returns the expected return type of the neuron.

experiment: jaxsnn.event.hardware.experiment.Experiment