Questions tagged [automatic-differentiation]

Also known as algorithmic differentiation, short AD. Techniques that take a procedure evaluating a numerical function and transform it into a procedure that additionally evaluates directional derivatives, gradients, higher order derivatives.

Also known as algorithmic differentiation, short AD. Techniques that take a procedure evaluating a numerical function and transform it into a procedure that additionally evaluates directional derivatives, gradients, higher order derivatives.

Techniques include operator

  • overloading for dual numbers,
  • operator overloading to extract the operations sequence as a tape,
  • code analysis and transformation.

For a function with input of dimension n and output of dimension n, requiring L elementary operations for its evaluation, one directional derivative or one gradient can be computed with 3*L operations.

The accuracy of the derivative is, automatically, nearly as good as the accuracy of the function evaluation.

Other differentiation method are

  • symbolic differentiation, where the expanded expression for the derivatives is obtained first, which can be large depending on the implementation, and
  • numerical differentiation by divided differences, which provides less accuracy with comparable effort, or comparable accuracy with a higher effort.

See wikipedia and autodiff.org

192 questions
0
votes
1 answer

pyadolc installation: avoiding "ImportError: No module named _adolc"

I am running Ubuntu 16.04. After getting the requirements and following the pyadolc installation steps here, I appended /home/my-name/pyadolc to the PYTHONPATH variable in my ~/.profile file. Now, running python -c "import adolc" returns the…
Francisco
  • 1
  • 1
0
votes
1 answer

How to properly match types when using Numeric.AD in Haskell?

I'm trying to implement Newton–Raphson root-finding algorithm using the ad package, but I can't properly match function types. I know there's a proper answer to a similar question, which was answered by the creator of ad himself, but the package…
luispauloml
  • 1,012
  • 1
  • 8
  • 16
0
votes
1 answer

AD Reflection - How does it work?

I have seen the ad package and i understand how it does automatic differentiation by providing a different instance of the class Floating and then implementing the rules of derivatives. But in the example Prelude Debug.SimpleReflect Numeric.AD> diff…
0
votes
1 answer

Runge-Kutta (RK4) for system of differential equations in Java

This quation is mostly a result of this thread: Differential Equations in Java. Basically, I've tried to follow Jason S. advise and to implement numerical solutions to differential equations via Runge-Kutta method (RK4). Hello everyone, I am…
Sergei G
  • 1,550
  • 3
  • 24
  • 44
0
votes
1 answer

How to treat boundary points in numerical differentiation?

I have a query on numerical differentiation that's beyond the language used. Suppose I have an array of n points x and f(x) and I want to take the first derivative of f(x). Every method will consume points making the derivative array shorter than…
0
votes
3 answers

Automatic Differentiation in C# and F#

I am having a problem getting Automatic Differentiation to work between C# and F#. In C# I have a function that takes a double and returns a double, say: private double Price(double yield) { double price; price = 0; for (int index = 1;…
Ash
  • 3,279
  • 4
  • 28
  • 26
0
votes
1 answer

Automatic differentiation of Matlab Coder generated C code

I have a Matlab function which I need to 1) Speed up 2) Generate derivatives of the function by means of Automatic Differentiation (AD). The speed up part I have accomplished by using Matlab Coder to generate C code and a mex function. Now I am…
Petter T
  • 3,387
  • 2
  • 19
  • 31
0
votes
0 answers

Hamiltonian mechanics-based physics engine

I am trying to implement a physics engine based around hamiltonian mechanics. Facing several problems, such as to Differentiate the H function Partially evaluate a partial derivative of the H function for an efficient use of the Runge-Kutta…
Ylfaue
  • 131
  • 1
  • 7
0
votes
1 answer

Does Theano support variable split?

In my Theano program, I want to split the tensor matrix into two parts, with each of them making different contributions to the error function. Can anyone tell me whether automatic differentiation support this? For example, for a tensor matrix…
0
votes
1 answer

Automatic probability densities

I have found automatic differentiation to be extremely useful when writing mathematical software. I now have to work with random variables and functions of the random variables, and it seems to me that an approach similar to automatic…
Deane
  • 101
  • 3
-2
votes
1 answer

How can I differentiate a function of a function?

I am trying to differentiate z(x) w.r.t. x using the ad library, where I know y(x) and z(y). If I cannot analytically find z(x), how can I perform the differentiation? In other words, I am trying to avoid the chain rule calculation as shown…
-3
votes
1 answer

Viewpager automatic scroll without handler postdelayed and setcurrentitem

I want to implement automatic viewpager scroll without using setCurrentItem() function. Because when i use setcurrentitem() with handler.postdelayed() it holds on after setting next item. and i want a smooth scroll like in recyclerview. Will it be…
1 2 3
12
13