squlearn.qnn.get_variance_fac

class squlearn.qnn.get_variance_fac(v: float, a: float, b: float, offset: int = 0)

Function for adjusting the variance regularization along the iterations.

Based on the sigmoid function, see Ref. [1] for details:

\[\alpha_{a,b,v}(i) = (1-v)\frac{\exp(a(b-i))}{\exp(a(b-i))+\frac{1}{b}}+v\]
Parameters:
  • v (float) – Minimal variance factor value

  • a (float) – Decay of the variance factor

  • b (float) – Length of the plateau in the beginning

  • offset (int) – Offset for the number of iterations (e.g. for restart) (default:0).

Returns:

Returns function with iteration as input for adjusting the variance factor

References

[1] D. A. Kreplin and M. Roth “Reduction of finite sampling noise in quantum neural networks”. arXiv:2306.01639 (2023).