zygote.jl-e88e6eb3-aa80-5325-afca-941959d7151f

Last mirrored from https://github.com/FluxML/Zygote.jl.git on 2019-11-19T08:14:45.723-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.44 , triggered by Travis cron job on branch "master"

https://github.com/unofficialjuliamirror/zygote.jl-e88e6eb3-aa80-5325-afca-941959d7151f

Science Score: 28.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Last mirrored from https://github.com/FluxML/Zygote.jl.git on 2019-11-19T08:14:45.723-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.44 , triggered by Travis cron job on branch "master"

Basic Info
  • Host: GitHub
  • Owner: UnofficialJuliaMirror
  • License: other
  • Language: Julia
  • Default Branch: master
  • Size: 1.19 MB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 7 years ago · Last pushed over 6 years ago
Metadata Files
Readme Funding License Citation

README.md

Build Status Dev Docs

] add Zygote

Zygote is a working prototype for source-to-source automatic differentiation (AD) in Julia, and the next-gen AD system for the Flux differentiable programming framework. For more details and benchmarks of Zygote's technique, see our paper.

You probably don't want to use Zygote yet (except as a preview of the future). Instead use Flux's built-in AD, which is API-compatible, and at some point in the near future you'll get a free speed boost.

```julia julia> using Zygote

julia> f(x) = 5x + 3

julia> f(10), f'(10) (53, 5)

julia> @codellvm f'(10) define i64 @"julia#625_38792"(i64) { top: ret i64 5 } ```

"Source-to-source" means that Zygote hooks into Julia's compiler, and generates the backwards pass for you – as if you had written it by hand.

Without compromising on performance, Zygote supports the full flexibility and dynamism of the Julia language, including control flow, recursion, closures, structs, dictionaries, and more.

```julia julia> fs = Dict("sin" => sin, "cos" => cos, "tan" => tan);

julia> gradient(x -> fsreadline(), 1) sin 0.5403023058681398 ```

Defining custom gradients is a cinch, and errors have good stacktraces.

```julia julia> using Zygote: @adjoint

julia> add(a, b) = a + b

julia> @adjoint add(a, b) = add(a, b), Δ -> (Δ, Δ) ```

To support large machine learning models with many parameters, Zygote can differentiate implicitly-used parameters, as opposed to just function arguments.

```julia julia> W, b = rand(2, 3), rand(2);

julia> predict(x) = W*x .+ b;

julia> g = gradient(Params([W, b])) do sum(predict([1,2,3])) end Grads(...)

julia> g[W], gb ```

Caveat Emptor

Zygote is in an early stage and may break, but issue reports and beta testing are welcome. In particular Zygote does not yet have comprehensive gradient definitions and may fail if it hits complex code in Base Julia.

Zygote's runtime performance should generally be good, but compile times are not optimised, so calling gradient the first time can have noticeable lag. BenchmarkTools is recommended to avoid measuring JIT time.

A current limitation is that Zygote will not automatically see redefined functions (for example if you call gradient(f, x), then redefine f, then take the gradient again). You can call Zygote.refresh() to completely reset what Zygote sees. It's often useful to have this in your script/notebook after function definitions.

The Julia compiler does not yet support all features needed to make Zygote fast, particularly in the presence of control flow. Until these are officially supported Zygote contains a flag to enable faster operation. If you can handle the additional caveats it's a good way to see Zygote's peak performance.

Owner

  • Name: Unofficial Julia Mirror
  • Login: UnofficialJuliaMirror
  • Kind: organization

Mirror of all registered Julia packages. Updated weekly by @UnofficialJuliaMirrorBot. See also: @UnofficialJuliaMirrorSnapshots.

Citation (CITATION.bib)

@article{Zygote.jl-2018,
  author    = {Michael Innes},
  title     = {Don't Unroll Adjoint: Differentiating SSA-Form Programs},
  journal   = {CoRR},
  volume    = {abs/1810.07951},
  year      = {2018},
  url       = {http://arxiv.org/abs/1810.07951},
  archivePrefix = {arXiv},
  eprint    = {1810.07951},
  timestamp = {Tue, 30 Oct 2018 20:39:56 +0100},
  biburl    = {https://dblp.org/rec/bib/journals/corr/abs-1810-07951},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

GitHub Events

Total
Last Year