You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to add one example of using gradient to do regression (for example, on sine curves) at the end of these gradient examples in https://www.tensorflow.org/quantum/tutorials/gradients? I would like to learn how to use the gradient after getting the gradient.
Good Idea, perhaps we could put another small section at the end of the tutorial showcasing a quick use case of the differentiator you just made. Let's leave this open in case anyone would like to take this on.
The new example reuses the tutorial’s circuit and custom differentiator to fit a phase offset to a sine curve shifted by 0.2. It uses tf.GradientTape to differentiate the mean squared error with respect to the offset, then applies 30 gradient descent updates starting from zero.
Activity
MichaelBroughton commentedon Feb 25, 2021
Good Idea, perhaps we could put another small section at the end of the tutorial showcasing a quick use case of the differentiator you just made. Let's leave this open in case anyone would like to take this on.
lockwo commentedon Aug 24, 2022
A tutorial hasn't been made, but there are examples of regression (e.g. https://github.com/lockwo/quantum_computation/blob/master/TFQ/vqc/boston_housing.py). Are you still looking for more information?
Merge pull request tensorflow#488 from MichaelBroughton/mps_rdm
mvanhorn commentedon Nov 20, 2026
The new example reuses the tutorial’s circuit and custom differentiator to fit a phase offset to a sine curve shifted by 0.2. It uses
tf.GradientTapeto differentiate the mean squared error with respect to the offset, then applies 30 gradient descent updates starting from zero.#1146