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

Role of dot product operation in forward-backward pass #29

Open
ahmed-tabib opened this issue Mar 19, 2024 · 0 comments
Open

Role of dot product operation in forward-backward pass #29

ahmed-tabib opened this issue Mar 19, 2024 · 0 comments

Comments

@ahmed-tabib
Copy link

Hello,
When reading the implementation, I noticed that in the forward-backward pass, you used a dot-product before running the backward pass, specifically in the following line:

surrogate = torch.dot(reps.flatten(), gradient.flatten())

I can't understand this, when reading the paper I imagined that you would directly use the gradients cached, something like:

reps.backward(gradient=gradients)

How exactly does the "surrogate" work to utilise the cached gradient? and why wouldn't the "standard" way of doing it work?
Thanks.

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

1 participant