Skip to content

How to do regression using gradient? #488

Description

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.

Thanks!

Activity

  1. MichaelBroughton commented on Feb 25, 2021

    @MichaelBroughton
    Collaborator

    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.

  2. lockwo commented on Aug 24, 2022

    @lockwo
    Contributor

    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?

  3. added a commit that references this issue on Mar 30, 2023
  4. added
    area/docsInvolves documentation – problems, ideas, requests
    on Dec 1, 2024
  5. added theissue type on Jun 6, 2026
  6. added
    help wantedHelp with this would be appreciated
    skill-level/intermediateOne or more of the areas need a solid understanding
    on Jun 6, 2026
  7. mvanhorn commented on Nov 20, 2026

    @mvanhorn

    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.

    #1146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsInvolves documentation – problems, ideas, requestshelp wantedHelp with this would be appreciatedkind/feature-requestNew feature or requestskill-level/intermediateOne or more of the areas need a solid understanding

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions