Coder Social home page Coder Social logo

willtebbutt / differentiationinterface.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gdalle/differentiationinterface.jl

0.0 0.0 0.0 662 KB

An interface to various automatic differentiation backends in Julia.

Home Page: https://gdalle.github.io/DifferentiationInterface.jl/

License: MIT License

Julia 100.00%

differentiationinterface.jl's Introduction

DifferentiationInterface

Dev Build Status Coverage Code Style: Blue

An interface to various automatic differentiation backends in Julia.

Goal

This package provides a backend-agnostic syntax to differentiate functions of the following types:

  • allocating: f(x) = y
  • mutating: f!(y, x) = nothing

Features

  • First and second order operators
  • In-place and out-of-place differentiation
  • Preparation mechanism (e.g. to create a config or tape)
  • Cross-backend testing and benchmarking utilities
  • Thorough validation on standard inputs and outputs (scalars, vectors, matrices)

Compatibility

We support most of the backends defined by ADTypes.jl:

backend object
ChainRulesCore.jl AutoChainRules(ruleconfig)
Diffractor.jl AutoDiffractor()
Enzyme.jl AutoEnzyme(Enzyme.Forward) or AutoEnzyme(Enzyme.Reverse)
FiniteDiff.jl AutoFiniteDiff()
FiniteDifferences.jl AutoFiniteDifferences(fdm)
ForwardDiff.jl AutoForwardDiff()
PolyesterForwardDiff.jl AutoPolyesterForwardDiff(; chunksize)
ReverseDiff.jl AutoReverseDiff()
Tracker.jl AutoTracker()
Zygote.jl AutoZygote()

We also provide one additional backend:

backend object
FastDifferentiation.jl AutoFastDifferentiation()

Example

julia> import ADTypes, ForwardDiff

julia> using DifferentiationInterface

julia> backend = ADTypes.AutoForwardDiff();

julia> f(x) = sum(abs2, x);

julia> value_and_gradient(f, backend, [1., 2., 3.])
(14.0, [2.0, 4.0, 6.0])

Related packages

differentiationinterface.jl's People

Contributors

gdalle avatar adrhill avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.