Skip to content

Commit 41eb447

Browse files
committed
Add docs for using AbstractDifferentiation
1 parent c485971 commit 41eb447

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/src/index.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,32 @@
33
Next-generation AD
44

55
[PDF containing the terminology](terminology.pdf)
6+
7+
## Getting Started
8+
9+
⚠️This certainly has bugs and issues. Please open issues on [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl/), or [AbstractDifferentiation.jl](https://github.com/JuliaDiff/AbstractDifferentiation.jl/issues) as appropriate.⚠️
10+
11+
Diffractor's public API is via [AbstractDifferentiation.jl](https://github.com/JuliaDiff/AbstractDifferentiation.jl/).
12+
Please see the AbstractDifferentiation.jl docs for detailed usage.
13+
14+
```@jldoctest
15+
julia> using Diffractor: DiffractorForwardBackend
16+
17+
julia> using AbstractDifferentiation: derivative
18+
19+
julia> derivative(DiffractorForwardBackend(), +, 1.5, 10.0)
20+
(1.0, 1.0)
21+
22+
julia> derivative(DiffractorForwardBackend(), *, 1.5, 10.0)
23+
(10.0, 1.5)
24+
25+
julia> jacobian(DiffractorForwardBackend(), prod, [1.5, 2.5, 10.0]) |> only
26+
1×3 Matrix{Float64}:
27+
25.0 15.0 3.75
28+
29+
julia> jacobian(DiffractorForwardBackend(), identity, [1.5, 2.5, 10.0]) |> only
30+
3×3 Matrix{Float64}:
31+
1.0 0.0 0.0
32+
0.0 1.0 0.0
33+
0.0 0.0 1.0
34+
```

0 commit comments

Comments
 (0)