Skip to content

Commit 15d7a4b

Browse files
Merge pull request #21 from nickrobinson251/npr/use-chainrules-docs
Share docs with ChainRules
2 parents 1c21db6 + ad4aa90 commit 15d7a4b

File tree

8 files changed

+15
-100
lines changed

8 files changed

+15
-100
lines changed

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,7 @@ notifications:
1515
# uncomment the following lines to override the default test script
1616
#script:
1717
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
18-
# - julia -e 'Pkg.clone(pwd()); Pkg.build("AbstractChainRules"); Pkg.test("AbstractChainRules"; coverage=true)'
18+
# - julia -e 'Pkg.clone(pwd()); Pkg.build("ChainRulesCore"); Pkg.test("ChainRulesCore"; coverage=true)'
1919
after_success:
2020
# push coverage results to Coveralls
2121
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
22-
jobs:
23-
include:
24-
- state: "Documentation"
25-
julia: 1.0
26-
os: linux
27-
script:
28-
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
29-
- julia --project=docs/ docs/make.jl
30-
after_success: skip

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@
22

33
[![Travis](https://travis-ci.org/JuliaDiff/ChainRulesCore.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/ChainRulesCore.jl)
44
[![Coveralls](https://coveralls.io/repos/github/JuliaDiff/ChainRulesCore.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaDiff/ChainRulesCore.jl?branch=master)
5-
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaDiff.github.io/ChainRulesCore.jl/latest)
5+
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaDiff.github.io/ChainRules.jl/latest)
66

7-
The ChainRulesCore package provides a variety of common utilities that can be used by downstream automatic differentiation (AD) tools to define and execute forward-, reverse-, and mixed-mode primitives.
7+
The ChainRulesCore package provides a light-weight dependency for defining sensitivities for functions in your packages, without you needing to depend on ChainRules itself.
88

9-
This package is a WIP; the framework is essentially there, but there are a bunch of TODOs, virtually no tests, etc. PRs welcome! Documentation is incoming, which should help if you'd like to contribute.
9+
This will allow your package to be used with [ChainRules.jl](https://github.com/JuliaDiff/ChainRules.jl), which aims to provide a variety of common utilities that can be used by downstream automatic differentiation (AD) tools to define and execute forward-, reverse-, and mixed-mode primitives.
1010

11-
Here are some of the basic goals for the package:
12-
13-
- First-class support for complex differentiation via Wirtinger derivatives.
14-
15-
- Mixed-mode composability without being coupled to a specific AD implementation.
16-
17-
- Propagation semantics built-in, with default implementations that allow rule authors to easily opt-in to common optimizations (fusion, increment elision, memoization, etc.).
18-
19-
- Control-inverted design: rule authors can fully specify derivatives in a concise manner while naturally allowing the caller to compute only what they need.
11+
This package is a work in progress; the framework is essentially there, but there are a bunch of TODOs, virtually no tests, etc. PRs welcome! The API is mostly documented, which should help if you'd like to contribute.
2012

2113
The ChainRulesCore source code follows the [YASGuide](https://github.com/jrevels/YASGuide).

docs/Project.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/make.jl

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/src/api.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/src/getting_started.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/src/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/rules.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ return that calculated differential value.
1111
1212
For example:
1313
14-
```julia-repl
14+
```jldoctest
1515
julia> using ChainRulesCore: frule, rrule, AbstractRule
1616
1717
julia> x, y = rand(2);
@@ -26,7 +26,7 @@ true
2626
2727
julia> Δx, Δy = rand(2);
2828
29-
julia> dh(Δx, Δy) == ((y / h) * Δx + (x / h) * Δy)
29+
julia> dh(Δx, Δy) == ((x / h) * Δx + (y / h) * Δy)
3030
true
3131
3232
julia> h, (dx, dy) = rrule(hypot, x, y);
@@ -39,10 +39,10 @@ true
3939
4040
julia> Δh = rand();
4141
42-
julia> dx(Δh) == (y / h) * Δh
42+
julia> dx(Δh) == (x / h) * Δh
4343
true
4444
45-
julia> dy(Δh) == (x / h) * Δh
45+
julia> dy(Δh) == (y / h) * Δh
4646
true
4747
```
4848
@@ -262,7 +262,7 @@ Examples:
262262
263263
unary input, unary output scalar function:
264264
265-
```julia-repl
265+
```jldoctest
266266
julia> x = rand();
267267
268268
julia> sinx, dsin = frule(sin, x);
@@ -276,7 +276,7 @@ true
276276
277277
unary input, binary output scalar function:
278278
279-
```julia-repl
279+
```jldoctest
280280
julia> x = rand();
281281
282282
julia> sincosx, (dsin, dcos) = frule(sincos, x);
@@ -318,7 +318,7 @@ Examples:
318318
319319
unary input, unary output scalar function:
320320
321-
```julia-repl
321+
```jldoctest
322322
julia> x = rand();
323323
324324
julia> sinx, dx = rrule(sin, x);
@@ -332,18 +332,18 @@ true
332332
333333
binary input, unary output scalar function:
334334
335-
```julia-repl
335+
```jldoctest
336336
julia> x, y = rand(2);
337337
338338
julia> hypotxy, (dx, dy) = rrule(hypot, x, y);
339339
340340
julia> hypotxy == hypot(x, y)
341341
true
342342
343-
julia> dx(1) == (y / hypot(x, y))
343+
julia> dx(1) == (x / hypot(x, y))
344344
true
345345
346-
julia> dy(1) == (x / hypot(x, y))
346+
julia> dy(1) == (y / hypot(x, y))
347347
true
348348
```
349349

0 commit comments

Comments
 (0)