calix.spiking.neuron

Provides an interface for calibrating LIF neurons.

Classes

NeuronCalibOptions(readout_neuron)

Further configuration parameters for neuron calibration.

NeuronCalibResult(target, options, neurons, …)

Result object of a neuron calibration.

NeuronCalibTarget(leak, numpy.ndarray] = 80, …)

Target parameters for the neuron calibration.

Functions

calix.spiking.neuron.calibrate(connection: pyhxcomm_vx.ConnectionHandle, target: Optional[calix.spiking.neuron.NeuronCalibTarget] = None, options: Optional[calix.spiking.neuron.NeuronCalibOptions] = None)calix.hagen.neuron_dataclasses.NeuronCalibResult

Calibrate neurons for spiking operation in the LIF model.

Parts of the calibration use the CADC, thus it has to be calibrated beforehand. All parameters are given in a “technical” domain. Parameters can be single values or numpy arrays shaped (512,), matching the number of neurons.

Requirements: - The CADCs are enabled and calibrated. You can achieve this using

the function calix.common.cadc.calibrate().

Parameters
  • connection – Connection to the chip to calibrate.

  • target – Calib target, given as an instance of NeuronCalibTarget. Refer there for the individual parameters.

  • options – Further options for neuron calibration.

Raises
  • TypeError – If time constants are not given with a unit from the quantities package.

  • ValueError – If parameters are badly shaped or out of feasible range.

calix.spiking.neuron.calibrate_leak_over_threshold(connection: pyhxcomm_vx.ConnectionHandle, result: calix.hagen.neuron_dataclasses.NeuronCalibResult, leak_over_threshold_rate: quantities.quantity.Quantity = array(100.) * kHz)

Calibrate neurons to a specific firing rate in leak over threshold setup, by adjusting the threshold.

The previously chosen threshold is disregarded here, it is not necessary to choose a leak over threshold setup beforehand. There has to be sufficient range between the reset and leak potential, though, in order to calibrate the threshold in between the two.

Parameters
  • connection – Connection to the chip to calibrate.

  • result – Result of the previous neuron calibration. The spike thresholds will be adjusted.

  • leak_over_threshold_rate – Target spike rate, given with a unit in the hardware time domain (so usual values are 10 to 100 kHz). The threshold is calibrated such that the neuron spikes with the given rate without any synaptic input. The previously calibrated threshold is threfore overwritten. If configuring an array in order to set individual targets per neuron, use a rate of zero to leave the threshold untouched.

calix.spiking.neuron.dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False)

Returns the same class as was passed in, with dunder methods added based on the fields defined in the class.

Examines PEP 526 __annotations__ to determine fields.

If init is true, an __init__() method is added to the class. If repr is true, a __repr__() method is added. If order is true, rich comparison dunder methods are added. If unsafe_hash is true, a __hash__() method function is added. If frozen is true, fields may not be assigned to after instance creation.

calix.spiking.neuron.refine_potentials(connection: pyhxcomm_vx.ConnectionHandle, result: calix.hagen.neuron_dataclasses.NeuronCalibResult, target: Optional[calix.spiking.neuron.NeuronCalibTarget] = None)None

Re-calibrate the leak, reset and threshold potentials.

This can be useful to minimize the effects of CapMem crosstalk on the end calibration. For best results, first run/apply a neuron calibration and then re-run the CADC calibration, as it is also affected by the neuron calibration. Call this function last.

Parameters
  • connection – Connection to the chip to re-calibrate.

  • result – Result of the previous neuron calibration. The potentials will be overwritten by the refinement.

  • target – Calib target parameters. Only the potentials (leak, reset, threshold) will be used and re-calibrated.