JuliaDiff / JuliaDiff/AbstractDifferentiation.jl

Whats the reason for the derivative / gradient difference?

Open
#61 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

design question
Dominant language
Julia
Stars
138
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Is there a reason to have a separate function derivative for the gradient wrt a scalar value? I find that it tends to make me have to add special cases where code would just work for both vectors and scalars if there was a definition of something like:

AD.gradient(ad::AD.AbstractBackend, f, x::Number) = AD.derivative(ad, f, x)

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 reading the AbstractDifferentiation interface around derivative and gradient on AD.AbstractBackend, then compare their scalar and vector contracts. Determine whether the proposed scalar gradient delegation preserves the existing API; done means the rationale is resolved and maintainers agree on the interface direction.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.