tensorflow / quantum

Hybrid Quantum-Classical Machine Learning in TensorFlow
https://www.tensorflow.org/quantum
Apache License 2.0
1.77k stars 558 forks source link

Improved parameters of SPSA #765

Open lockwo opened 1 year ago

lockwo commented 1 year ago

I was encountering some poor performance and was able to track down the cause to 2 places. 1) there was a mistake in the scaling of the new learning rate (it should be 10%, not 1% of total iterations), and 2) a better default learning rate is 0.05 * ((maxiter * 0.1) + 1) ** alpha (per https://docs.pennylane.ai/en/stable/_modules/pennylane/optimize/spsa.html#SPSAOptimizer), which for default values is actually 0.05 * ((200 * 0.1) + 1) ** 0.602 = 0.31.