Fork me on GitHub

Automatic differentiation in pure Go.
Planned, wave 2 of the go-scikit roadmap.

go-autodiff is the planned home of automatic differentiation for go-scikit: forward and reverse modes, with Jacobian and Hessian helpers that feed go-numerics/optimize gradients and the JacFunc of go-numerics/integrate, both of which take user-supplied derivatives or finite differences today. It is in wave 2 (PLAN.md item 8). There is no library and no release yet: this page says what is planned, in which wave, and against which references it will be validated.

planned wave 2no release yetCGO=0 pure Go
status
org      go-autodiff
domain   automatic differentiation
status   planned (wave 2)
release  none yet
oracles  JAX, finite differences
plan     go-scikit/roadmap: PLAN.md, STATUS.md
Planned, wave 2: no library is released. The plan is PLAN.md, the state of each item STATUS.md.
What go-autodiff will cover

automatic differentiation, in pure Go.

go-autodiff is the planned home of automatic differentiation for go-scikit: forward and reverse modes, with Jacobian and Hessian helpers that feed go-numerics/optimize gradients and the JacFunc of go-numerics/integrate, both of which take user-supplied derivatives or finite differences today. It is in wave 2 (PLAN.md item 8). Everything below is planned, not released.

โ†’

Forward mode

Dual and hyper-dual numbers: one sweep per Jacobian-vector product, simple and exact to rounding.

โ†

Reverse mode

A tape (Wengert list) recorded by calling tape methods: one sweep per gradient.

โˆ‡

Jacobians and Hessians

Helpers for Jacobians and Hessians, with forward-over-reverse Hessian-vector products.

โš™

Feeds the solvers

Gradients for optimize, and an AD-built Jacobian for the stiff solvers' JacFunc in integrate.

๐Ÿงช

Checked three ways

Against analytic derivatives, against finite differences (CheckGrad), and against JAX as an oracle.

๐Ÿงญ

Honest about Go

Go has no operator overloading, so user code is written against an AD type; the design weighs duals, a tape, source transformation and generics.

๐Ÿ“ฆ

Pure Go, CGO=0

No cgo, the same results on every architecture the fleet tests.

โš–๏ธ

BSD-3-Clause

GPL implementations (pbenner/autodiff) are read-only; Tapenade, Enzyme and JAX are design references and oracles.

How it will be checked

3 kinds of check, each against a reference.

Every go-scikit library is validated against the tool that is the reference of its domain, run as an oracle from Go. These are the criteria planned for go-autodiff.

Against analytic derivatives

Forward and reverse results must be exact to rounding; the report is the maximum relative error and ULPs.

Against finite differences

CheckGrad agrees to O(h), the truncation order of the difference.

Against JAX

Jacobians and Hessians from JAX (uv run --with jax) serve as reference values, driven from Go with JSON on a pipe.

Repositories

What is planned, and what is here.

ad

planned (wave 2)

Planned (wave 2). Forward (dual) and reverse (tape) automatic differentiation with Jacobian and Hessian helpers for `optimize` and `integrate`. The repository name `ad` is proposed, not created.

docs

site

The documentation (Hugo + Hextra): the scope, the plan and the references of each planned library. Source โ†’

brand

assets

Logos and icons for the organization, in SVG / PNG / JPG / ICO / ICNS across colour, white and black variants.

automatic differentiation for go-scikit.

go-autodiff is planned, wave 2. The documentation holds its scope, its plan and its references; the roadmap is PLAN.md.

Read the source on GitHub โ†’