Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation quick question #17

Open
macrocredit opened this issue Jul 17, 2023 · 2 comments
Open

Implementation quick question #17

macrocredit opened this issue Jul 17, 2023 · 2 comments

Comments

@macrocredit
Copy link

Hi - Great work!

I have one question:

loss, jvp = fc.jvp(f, (tuple(params),), (v_params,))

Do you know why jvp is a scalar? I would have thought that this is a matrix. Also, is there a reason why we are calling tuple(params) instead of params?

Thank you.

@macrocredit macrocredit changed the title Quick implementation question Implementation quick question Jul 17, 2023
@FITZET
Copy link

FITZET commented Oct 26, 2023

i also found that the jvp is a scalar, and i'm not sure how the jvp is calculated. i want a formula to show the computing flow layer by layer, do you know how to get the formula?

@inikishev
Copy link

inikishev commented Dec 31, 2024

Hi - Great work!

I have one question:

loss, jvp = fc.jvp(f, (tuple(params),), (v_params,))

Do you know why jvp is a scalar? I would have thought that this is a matrix. Also, is there a reason why we are calling tuple(params) instead of params?

Thank you.

its dot product of jacobian with a random vector, which is the same as directional derivative in the direction of that vector. Params are a tuple because I believe jvp in pytorch requires a tuple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants