calix.common.algorithms.PredictiveModel
-
class
calix.common.algorithms.
PredictiveModel
(probe_parameters: Union[int, numpy.ndarray]) Bases:
calix.common.base.Algorithm
Base class for predictive models, which calculate the ideal parameters to achieve a target result based on a model. The models predict() function translates desired results into parameters. As there are differences between instances of the same thing on the chip, which is usually target of calibration, a shift of the model per instance is determined before calculating the optimal parameters. This means probe_parameters are configured and measured, used as shift, then the model prediction is calculated and returned. Running the algorithm, the shifts described above are measured at the probe parameters, then the parameters returned from the prediction are ensured to be in the allowed parameter range and set up on the chip before returning.
- Variables
probe_parameters – Parameters to use when determining the shift each instance has with respect to the expected model.
-
__init__
(probe_parameters: Union[int, numpy.ndarray]) Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(probe_parameters)Initialize self.
run
(connection, target_result)Run the algorithm, i.e. configure the probe parameters, measure results there, calculate optimal parameters based on this measurement and the model, and set these up.
-
run
(connection: pyhxcomm_vx.ConnectionHandle, target_result: Union[float, int, numpy.ndarray]) → numpy.ndarray Run the algorithm, i.e. configure the probe parameters, measure results there, calculate optimal parameters based on this measurement and the model, and set these up.
- Parameters
connection – Connection connected to the chip to run on.
target_result – Array or single value to be aimed for.
- Returns
Array containing the parameters which are expected to yield results closest to the desired target results. All parameters are in the allowed ParameterRange.