qiskit.algorithms.optimizers.SPSA.calibrate¶
- static SPSA.calibrate(loss, initial_point, c=0.2, stability_constant=0, target_magnitude=None, alpha=0.602, gamma=0.101, modelspace=False, max_evals_grouped=1)[código fonte]¶
Calibrate SPSA parameters with a powerseries as learning rate and perturbation coeffs.
The powerseries are:
\[a_k = \frac{a}{(A + k + 1)^\alpha}, c_k = \frac{c}{(k + 1)^\gamma}\]- Parâmetros
loss (Callable[[np.ndarray], float]) – The loss function.
initial_point (np.ndarray) – The initial guess of the iteration.
c (float) – The initial perturbation magnitude.
stability_constant (float) – The value of A.
target_magnitude (float | None) – The target magnitude for the first update step, defaults to \(2\pi / 10\).
alpha (float) – The exponent of the learning rate powerseries.
gamma (float) – The exponent of the perturbation powerseries.
modelspace (bool) – Whether the target magnitude is the difference of parameter values or function values (= model space).
max_evals_grouped (int) – The number of grouped evaluations supported by the loss function. Defaults to 1, i.e. no grouping.
- Retorno
- A tuple of powerseries generators, the first one for the
learning rate and the second one for the perturbation.
- Tipo de retorno
tuple(generator, generator)