# How does qiskit's CircuitQNN calculate the gradients of circuits?

I'm trying to understand how the gradients are calculated for any given circuit using qiskits CircuitQNN and NeuralNetworkClassifier. I've been looking trough the source on github but haven't found any real "definition" per se, and going through the code leaves much to be desired, atleast from my understand. So, how does it work, or where can I read up on it?

If we calculate the gradients of the probabilities to measure one of the $$2^n$$ basis states, the circuit implementing the gradient is sampled $$M$$ (generally smaller than $$2^n$$ to avoid exponential cost) times and the gradients are constructed from the shot histogram.