All Projects → alexshtf → autodiff

alexshtf / autodiff

Licence: MIT license
A .NET library that provides fast, accurate and automatic differentiation (computes derivative / gradient) of mathematical functions.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to autodiff

Mathematics for Machine Learning
Learn mathematics behind machine learning and explore different mathematics in machine learning.
Stars: ✭ 28 (-59.42%)
Mutual labels:  math, mathematics
tukey
Mini stats toolkit for Clojure/Script
Stars: ✭ 17 (-75.36%)
Mutual labels:  math, mathematics
Mathos-Project
The Mathos Core Library
Stars: ✭ 22 (-68.12%)
Mutual labels:  math, mathematics
Tau.jl
A Julia module providing the definition of the circle constant Tau (2π)
Stars: ✭ 33 (-52.17%)
Mutual labels:  math, mathematics
math eval
✖️➕➖➗ `math_eval` safely evaluates mathematical expressions
Stars: ✭ 33 (-52.17%)
Mutual labels:  math, mathematics
codex
A repository of mathematical knowledge written in the MathLingua language.
Stars: ✭ 17 (-75.36%)
Mutual labels:  math, mathematics
graphest
A faithful graphing calculator
Stars: ✭ 42 (-39.13%)
Mutual labels:  math, mathematics
Fourier-and-Images
Fourier and Images
Stars: ✭ 81 (+17.39%)
Mutual labels:  math, mathematics
maths-for-deep-learning-ai
A open source book covering the foundational maths of deep learning and machine learning using TensorFlow
Stars: ✭ 35 (-49.28%)
Mutual labels:  math, mathematics
mish
A no-std libm implementation in Rust
Stars: ✭ 14 (-79.71%)
Mutual labels:  math, mathematics
Oscar.jl
A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
Stars: ✭ 182 (+163.77%)
Mutual labels:  math, mathematics
okama
Investment portfolio and stocks analyzing tools for Python with free historical data
Stars: ✭ 87 (+26.09%)
Mutual labels:  optimization, mathematics
MissionImpossible
A concise C++17 implementation of automatic differentiation (operator overloading)
Stars: ✭ 18 (-73.91%)
Mutual labels:  automatic-differentiation, autodiff
dopt
A numerical optimisation and deep learning framework for D.
Stars: ✭ 28 (-59.42%)
Mutual labels:  optimization, automatic-differentiation
Linear-Algebra-and-Its-Applications-notes
《线性代数及其应用》笔记
Stars: ✭ 196 (+184.06%)
Mutual labels:  math, mathematics
pyrgg
🔧 Python Random Graph Generator
Stars: ✭ 158 (+128.99%)
Mutual labels:  math, mathematics
speedy-math
An application which allows user (small kids) to practice basic Mathematics operations
Stars: ✭ 28 (-59.42%)
Mutual labels:  math, mathematics
noteworthy
Markdown editor with bidirectional links and excellent math support, powered by ProseMirror. (In Development!)
Stars: ✭ 178 (+157.97%)
Mutual labels:  math, mathematics
string-math
Evaluates a math expression from a string. Supports variables and custom operators.
Stars: ✭ 14 (-79.71%)
Mutual labels:  math, mathematics
rclc
Mathematical expression calculator with big integers, floats, common fractions, and complex numbers support
Stars: ✭ 24 (-65.22%)
Mutual labels:  math, mathematics
AppVeyor CI NuGet Package
Build Status NuGet

Project Description

A library that provides moderately fast, accurate, and automatic differentiation (computes derivative / gradient) of mathematical functions.

AutoDiff provides a simple and intuitive API for computing function gradients/derivatives along with a fast algorithm for performing the computation. Such computations are mainly useful in iterative numerical optimization scenarios.

Code example

using AutoDiff;

class Program
{
    public static void Main(string[] args)
    {
            // define variables
            var x = new Variable();
            var y = new Variable();
            var z = new Variable();
    
            // define our function
            var func = (x + y) * TermBuilder.Exp(z + x * y);
    
            // prepare arrays needed for evaluation/differentiation
            Variable[] vars = { x, y, z };
            double[] values = {1, 2, -3 };
    
            // evaluate func at (1, 2, -3)
            double value = func.Evaluate(vars, values);
    
            // calculate the gradient at (1, 2, -3)
            double[] gradient = func.Differentiate(vars, values);
    
            // print results
            Console.WriteLine("The value at (1, 2, -3) is " + value);
            Console.WriteLine("The gradient at (1, 2, -3) is ({0}, {1}, {2})", gradient[0], gradient[1], gradient[2]);
    }
}

Documentation

The Documentation contains some basic tutorials, we have an article on CodeProject, and finally source code contains some code examples in addition to the code of the library itself.

Motivation

There are many open and commercial .NET libraries that have numeric optimization as one of their features (for example, Microsoft Solver Foundation, AlgLib,Extreme Optimization, CenterSpace NMath) . Most of them require the user to be able to evaluate the function and the function's gradient. This library tries to save the work in manually developing the function's gradient and coding it. Once the developer defines his/her function, the AutoDiff library can automatically evaluate and differentiate this function at any point. This allows easy development and prototyping of applications which require numerical optimization.

Features

  • Moderate execution speeds. We aim computing a gradient within no more than 50 times the duration of function evaluation by manually tuned code.
  • Composition of functions using arithmetic operators, Exp, Log, Power and user-defined unary and binary functions.
  • Function gradient evaluation at specified points
  • Function value evaluation at specified points
  • Computes gradients using Reverse-Mode AD algorithm in linear time, which is substantially faster than numerical gradient approximation for multivariate functions.

Using in research papers

If you like the library and it helps you publish a research paper, please cite the paper I originally wrote the library for geosemantic.bib

Used by

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].