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

support substraction on Tangent{T} #641

Closed
oxinabox opened this issue Dec 7, 2023 · 2 comments · Fixed by #660
Closed

support substraction on Tangent{T} #641

oxinabox opened this issue Dec 7, 2023 · 2 comments · Fixed by #660
Labels
good first issue Good for newcomers Structural Tangent Related to the `Tangent` type for structured (composite) values

Comments

@oxinabox
Copy link
Member

oxinabox commented Dec 7, 2023

We could support subtraction on Tangent{T} just as -(t1,t2) = t1 + -1*t2

Diffractor has an internal higher order rule that assumed such things exist. (https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/higher_fwd_rules.jl#L44)
But I am not sure if people really should expect to be able to do this for structural tangents.
(I am currently working with a weird number type kinda like a unitful thing but less comprehensive)

@oxinabox oxinabox added the Structural Tangent Related to the `Tangent` type for structured (composite) values label Dec 7, 2023
@oxinabox
Copy link
Member Author

If implementing this we should do it for all tangent types.
This need was mentioned in #639
as well.
And I think it makes sense for writing gradient descent etc.

@lukas-weber would you like to take a crack at this?

@oxinabox oxinabox added the good first issue Good for newcomers label Dec 14, 2023
@lukas-weber
Copy link
Contributor

Sure can do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Structural Tangent Related to the `Tangent` type for structured (composite) values
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants