calix.hagen.neuron_synin.SynBiasCalib
-
class
calix.hagen.neuron_synin.
SynBiasCalib
(target_leak_read: Optional[numpy.ndarray] = None, parameter_range: calix.common.base.ParameterRange = ParameterRange(lower=0, upper=1022), target: Optional[numpy.ndarray] = None, recalibrate_reference: bool = True) Bases:
calix.common.base.Calib
Calibrate the strength of synaptic inputs to match for all neurons.
This is done using inputs of multiple rows of synapses at medium weight, with STP disabled, as set during the prelude. With these longer pulses, the mismatch of synapses should be minimal. The bias currents of the synaptic input OTAs are tweaked such that the difference in CADC reads before and after sending inputs match.
Requirements: * Neuron membrane readout is connected to the CADCs (causal and acausal). * Synaptic currents can reach the neurons (hal.ColumnCurrentSwitch). * The membrane time constant is long, so that sucessive input events
accumulate.
The selected synaptic time constant and synapse DAC bias current are not too large, so that the amplitudes resulting from a single stimulus don’t already saturate the usable dynamic range at the CADC.
- Variables
syn_ref_calib – Instance of a SynReferenceCalib, configured with the given target_leak_read. The synaptic input reference potentials are recalibrated every time after changing the synaptic input OTA bias current.
n_events – Number of events to send during integration of amplitudes in measure_results(). During prelude the number of events might be reduced if the measured amplitudes are too high.
n_runs – Number of runs to average results from during measurement of amplitudes.
wait_between_events – Wait time between two successive input events.
reliable_amplitudes – Maximum amplitude that is reliably observable using the CADC. Used to find n_events during prelude.
recalibrate_reference – Decide whether the OTA’s reference potential is recalibrated during prelude and each time the bias current is touched.
-
__init__
(target_leak_read: Optional[numpy.ndarray] = None, parameter_range: calix.common.base.ParameterRange = ParameterRange(lower=0, upper=1022), target: Optional[numpy.ndarray] = None, recalibrate_reference: bool = True) - Parameters
target_leak_read – Target CADC read for synaptic input reference potential calibration, which is called after each change of the bias current. This parameter must be given if recalibrate_reference is True (default), but can be left None otherwise.
parameter_range – Allowed range of synaptic input OTA bias current.
target – Target amplitudes for events. If given, the measurement of target amplitudes in prelude is skipped. This can be useful when calibrating inhibitory and excitatory synaptic inputs to the same amplitude targets.
recalibrate_reference – Decide whether the OTA’s reference potential is recalibrated during prelude and each time the bias current is touched.
- Raises
ValueError – If target_leak_read is None while recalibrate_references is True.
Methods
__init__
([target_leak_read, …])- param target_leak_read
Target CADC read for synaptic input
configure_parameters
(builder, parameters)Configure the bias current of the synaptic input OTA of all neurons to the given parameters.
measure_amplitudes
(connection, builder[, …])Send stimuli to all neurons using a few rows of synapses (as set during the prelude).
measure_results
(connection, builder)Measure results of calibration.
postlude
(connection)Log statistics of the event amplitudes after calibration.
prelude
(connection)Preconfigure synapse drivers to send excitatory/inhibitory signals to all connected synapses.
-
configure_parameters
(builder: calix.common.base.WriteRecordingPlaybackProgramBuilder, parameters: numpy.ndarray) → calix.common.base.WriteRecordingPlaybackProgramBuilder Configure the bias current of the synaptic input OTA of all neurons to the given parameters. The target can be the excitatory or the inhibitory synaptic input circuit depending on the class properties.
- Parameters
builder – Builder to append configuration instructions to.
parameters – Synaptic input OTA bias current.
- Returns
Builder with configuration instructions appended.
-
measure_amplitudes
(connection: pyhxcomm_vx.ConnectionHandle, builder: calix.common.base.WriteRecordingPlaybackProgramBuilder, recalibrate_syn_ref: Optional[bool] = None) → numpy.ndarray Send stimuli to all neurons using a few rows of synapses (as set during the prelude). The number of inputs in one run as well as the number of runs can be varied, the mean of all experiments is returned.
Returns the difference in CADC reads after and before stimulation. The result uses the appropriate sign depending on excitatory or inhibitory mode, i.e. is normally positive.
- Parameters
connection – Connection to the chip to run on.
builder – Builder to append stimulate/read instructions, then gets executed.
recalibrate_syn_ref – Switch if the synaptic input reference has to be recalibrated before measuring amplitudes.
- Returns
Array of amplitudes resulting from stimulation.
-
measure_results
(connection: pyhxcomm_vx.ConnectionHandle, builder: calix.common.base.WriteRecordingPlaybackProgramBuilder) → numpy.ndarray Measure results of calibration.
Calls the measure_amplitudes function using the default setting to recalibrate the synaptic reference potentials before measuring. This function only exists to keep the same arguments as in the base calib class.
- Parameters
connection – Connection to the chip to run on.
builder – Builder to append stimulate/read instructions, then gets executed.
- Returns
Array of amplitudes resulting from stimulation.
-
postlude
(connection: pyhxcomm_vx.ConnectionHandle) → None Log statistics of the event amplitudes after calibration.
- Parameters
connection – Connection to the chip to run on.
-
prelude
(connection: pyhxcomm_vx.ConnectionHandle) → None Preconfigure synapse drivers to send excitatory/inhibitory signals to all connected synapses. Measure current amplitudes and use the median as target for calibration, which can be overwritten by providing a target to the run() method. If an amplitude higher than the reliable range is obtained, the parameter self.n_events is reduced and it is measured again.
- Parameters
connection – Connection to the chip to run on.
- Raises
CalibNotSuccessful – If obtained target amplitudes are still too high after reducing self.n_events.