JuliaDiff / JuliaDiff/ReverseDiff.jl

ReverseDiff for derivatives of custom types?

Open
#194 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.