JuliaDiff / JuliaDiff/ReverseDiff.jl
ReverseDiff for derivatives of custom types?
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 393
- Forks
- 60
- Avg merge
- 18h 24m
- Merged PRs (30d)
- 8
Description
Hi,
I need to evaluate the gradient of a function with my custom type/operations. For example if f(x) = x^3, I want the derivative obtained with the usual rules of calculus (i.e. df(x)=3*x^2), to be evaluated for typeof(x) = foo. Of course I have pre-defined the operations *(a::Number,b::foo) and ^(a::foo,n::Integer), etc...
I know that Zygote can easily do this, but it is about an order of magnitude slower than ReverseDiff for my problem and Real inputs, so I would rather prefer to use a compiled tape and ReverseDiff.
Thanks,
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the requested gradient calculation for a custom foo type using the operations described in the issue, then inspect ReverseDiff's compiled-tape path. Done means ReverseDiff can evaluate the expected derivative for f(x) = x^3 with the custom type while retaining the requested compiled-tape behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100