DiffSharp is an automatic differentiation (AD) library. AD allows exact and efficient calculation of derivatives, by systematically invoking the chain rule of calculus at the elementary operator level during program execution. AD is different from numerical differentiation, which is prone to truncation and round-off errors, and symbolic differentiation, which is affected by expression swell and cannot fully handle algorithmic control flow. Using the DiffSharp library, derivative calculations (gradients, Hessians, Jacobians, directional derivatives, and matrix-free Hessian- and Jacobian-vector products) can be incorporated with minimal change into existing algorithms. Diffsharp supports nested forward and reverse AD up to any level, meaning that you can compute exact higher-order derivatives or differentiate functions that are internally making use of differentiation. Please see the API Overview page for a list of available operations. The library is under active development by Atılım Güneş Baydin and Barak A. Pearlmutter mainly for research applications in machine learning, as part of their work at the Brain and Computation Lab, Hamilton Institute, National University of Ireland Maynooth. DiffSharp is implemented in the F# language and can be used from C# and the other languages running on .NET Core, Mono, or the .NET Framework; targeting the 64 bit platform. It is tested on Linux and Windows. We are working on interfaces/ports to other languages.


Keywords
Differentiation, Automatic, Symbolic, Numerical, Optimization, Machine, Learning, FSharp, F#, autodiff, deep-learning, dotnet, gpu, machine-learning, neural-network, tensor
License
BSD-2-Clause
Install
Install-Package DiffSharp -Version 0.8.4-beta

Documentation

DiffSharp: Differentiable Functional Programming

DiffSharp is a functional automatic differentiation (AD) library implemented in the F# language. It supports C# and the other CLI languages. The library is being developed mainly for research applications in machine learning, by Atılım Güneş Baydin and Barak A. Pearlmutter, within the Brain and Computation Lab, National University of Ireland Maynooth.

Please visit the project website for detailed documentation and examples.

You can come and join the Gitter chat room, if you want to chat with us:

Join the chat at https://gitter.im/DiffSharp/DiffSharp

Project statistics

Issue Stats Issue Stats

Current build status

Build status (Windows)

Build Status (Unix/Mono)

License

Copyright (c) 2016- University of Oxford (Atilim Gunes Baydin)
Copyright (c) 2017- Microsoft Research, Cambridge, UK (Don Syme)
Copyright (c) 2014- National University of Ireland Maynooth (Barak A. Pearlmutter)
Copyright (c) 2014-2016 National University of Ireland Maynooth (Atilim Gunes Baydin)

DiffSharp is licensed under the BSD 2-clause "Simplified" license, which means that redistribution and use in source and binary forms, with or without modification, are permitted provided that the authors listed above are properly acknowledged by following the conditions in the attached LICENSE file.

Other licenses

DiffSharp uses:

  • OpenBLAS by Zhang Xianyi, Wang Qian, Werner Saar (BSD license) for BLAS/LAPACK operations
  • F# Quotations Evaluator by Paul Westcott and others (Unlicense/public domain) for compiling code quotations