calix.hagen.neuron_leak_bias.LeakBiasCalib
-
class
calix.hagen.neuron_leak_bias.
LeakBiasCalib
(target: Union[numbers.Number, numpy.ndarray] = 1.2, target_leak_read: Optional[Union[numbers.Number, numpy.ndarray]] = None, masking_threshold: Optional[Union[numbers.Number, numpy.ndarray]] = None) Bases:
calix.common.base.Calib
Set leak bias currents as low as possible while preventing the membrane voltage from floating and preventing too high membrane noise.
Search all neurons’ leak OTA bias current settings such that the potential does not float away, i.e. the noise in successive CADC reads is close to the given target noise and the resting potential is not far from the expected leak potential CADC value. The leak current is set as low as possible fulfilling this requirement.
When integrating inputs on the neuron, a low leak conductivity is desired. However, some neurons show strong variations on the membrane potential when the leak conductivity is set very low, as the voltage now floats. Some neurons may require a higher leak setting in order to keep the membrane potential from floating.
The noise on the membrane is quantified by reading the CADCs multiple times. The leak current is set such that the target noise is achieved. This yields a minimum leak conductivity while keeping the membrane from floating.
- Calling the run() function returns this tuple of parameters:
Array of calibrated leak OTA bias current settings
Mask of too noisy neurons. False for neurons exceeding the
masking_threshold.
Requirements: * Neuron membrane readout is connected to the CADCs (causal and acausal). * Reset potential is equal to the leak potential. * Synaptic inputs are calibrated such that the membrane potential is
not affected by constant currents.
- Variables
masking_threshold – Threshold for noise to set calibration success to False. Should be higher than the target noise. By default, target + 0.8 is used, as the default noise target is only 1.2 LSB. Note that besides the pure statistical noise, a penalty is added to the “noise” result in case the mean resting potential is far from the expected value, i.e., the potential drifts too far. This pentalty is also considered when finding calibration success. See the function optimization_objective() in measure_results() for the specific penalty conditions.
target_leak_read – Expected CADC reads at leak potential. Used to decide whether the membrane potential is floating.
-
__init__
(target: Union[numbers.Number, numpy.ndarray] = 1.2, target_leak_read: Optional[Union[numbers.Number, numpy.ndarray]] = None, masking_threshold: Optional[Union[numbers.Number, numpy.ndarray]] = None) - Parameters
target – Noise on each neuron’s CADC reads (standard deviation of successive CADC reads).
Methods
__init__
([target, target_leak_read, …])- param target
Noise on each neuron’s CADC reads (standard
configure_parameters
(builder, parameters)Configure leak OTA bias currents to the given parameters.
measure_results
(connection, builder)Measure the noise on each neuron’s membrane.
postlude
(connection)Logs warnings for neurons with higher noise and statistics.
prelude
(connection)Measure the current resting potentials and use them as target_leak_read, if the parameter was not provided.
-
configure_parameters
(builder: calix.common.base.WriteRecordingPlaybackProgramBuilder, parameters: numpy.ndarray) → calix.common.base.WriteRecordingPlaybackProgramBuilder Configure leak OTA bias currents to the given parameters.
- Parameters
builder – Builder to append configuration to.
parameters – Leak OTA bias current settings for each neuron.
- Returns
Builder with configuration commands appended.
-
measure_results
(connection: pyhxcomm_vx.ConnectionHandle, builder: calix.common.base.WriteRecordingPlaybackProgramBuilder) → numpy.ndarray Measure the noise on each neuron’s membrane.
To do that, successive CADC reads are done. These happen a small amount of time after a reset. The reset - wait - read scheme is what we will use in hagen mode, therefore we measure the noise in the same fashion. The standard deviation of these reads is treated as noise.
If the resting potential is far from the potential after reset, or the potential after reset is far from the expected leak potential, the membrane potential is assumed to be floating; therefore, the result is artificially increased in order to have the leak bias current increased for these neurons.
- Parameters
connection – Connection to the chip to run on.
builder – Builder to append read instructions to.
- Returns
Array with standard deviations of CADC reads of each neuron.
-
postlude
(connection: pyhxcomm_vx.ConnectionHandle) → None Logs warnings for neurons with higher noise and statistics. Change mask of calibration success to False for neurons with noise significantly higher than the target.
- Parameters
connection – Connection to the chip to run on.
-
prelude
(connection: pyhxcomm_vx.ConnectionHandle) Measure the current resting potentials and use them as target_leak_read, if the parameter was not provided.
- Parameters
connection – Connection to the chip to run on.