-
Notifications
You must be signed in to change notification settings - Fork 7
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
Tangent Interface Docs #434
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
|
Performance Ratio:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried to implement a tangent type and use these functions, so couldn't verify claims like If all the tests in these functions pass, then you have satisfied the interface.
All the comments are only cosmetic.
But this is clearly a really good clarification!
# Tangents | ||
|
||
As discussed in [Representing Gradients](@ref), Mooncake requires that each "primal" type be associated to a unique "tangent" type, given by the function [tangent_type](@ref). | ||
Moreover, we must be able to "split" a given tangent into its _fdata_ ("forwards-data") and _rdata_ ("reverse-data"), whose types are given by [fdata_type](@ref) and `rdata_type` respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe miss ref
for rdata_type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. For some reason, it didn't like me doing that. I'm not 100% sure why.
Signed-off-by: Will Tebbutt <[email protected]>
@willtebbutt I've had a look at these docs and tried to implement the interface for a custom type. I was almost able to, but in particular I had to add methods for
in addition to those in the interface. I also ran into problems with a generated function, which I didn't find a way around. I've put a MWE in this notebook: https://jollywatt.github.io/notes/mooncake-self-tangents |
Thanks -- I'll take a look at your notebook! |
@Jollywatt @willtebbutt I suggest that you take a look at #428 (comment) as part of "integration testing" this PR's completeness and accuracy. Defining a macro that can help users extend tangent types for their Julia types will be nice. |
@Jollywatt per our discussion elsewhere, here is a stab at aggregating all of the information that I have about the tangent interface into a single location. When you get a minute, could you let me know if this is the kind of thing that you need to do what you wanted to do, or if there's additional info that you'll need?