

In the adjoint run, the graph is traversed in reverse order, propagating the adjoint value of the output towards the inputs. The edge weights are the partial derivatives of the respective computations. Vertices represent variables accessed in the augmented primal run, including temporary instantiations from the Figure 1 displays the computational graph of the matrix-matrix multiplication kernel in Listing 1.1. The tape is an implementation dependent representation of the computational graph of the program, which contains all performed computations and their corresponding partial derivatives. Operators in line 6, are overloaded by the tool and act as the entry points for taping. As mentioned in the previous section, the AD-O tool first performs the augmented primal run when in adjoint mode. For an active evaluation, the function must be called using the custom AD data type of an AD-O tool as
#Eigenmath user guide code#
The primal code is called using the passive data type Note than an extended version of this work exists refer to it for further details. Section 5 summarizes the results and suggests possible future works.

It contains several optimizations and improvements for the application of an AD-O tool, which are demonstrated and benchmarked using Section 3 presents Eigen-AD which is a fork of Eigen. The next section provides more background on AD-O and also introduces the concept of symbolic derivatives. This work proposes approaches and solutions to overcome them. However, several problems concerning performance and feasibility of the derivative computation will arise from this concept. Swapping the data type of Eigen and using the AD-O tool as usual should be all that is required to compute derivatives. The goal is that the AD-O tool user benefits from optimizations without explicitly being aware of them. To our best knowledge, there has not been a work focusing on the application of an AD-O tool to Eigen while preserving the philosophy of plain AD-O. 3 in collaboration with RWTH Aachen University. , which is an AD-O tool actively developed by NAG Ltd. At a later point in this paper, concrete implementations and benchmarks for AD-O in Eigen will be presented using Eigen allows the direct utilization of AD-O tools due to its extensive use of Adept or the Stan Math Library, where the latter makes heavy use of Eigen.
#Eigenmath user guide software#
Therefore, software combining AD-O and linear algebra has been realized with, e.g. This change in data type is often impractical and breaks hand tuned performance gains . The propagation in the adjoint run is known as interpreting the tape.Īpplying an AD-O tool to dedicated libraries poses a significant issue, as by principle they require the usage of an extended floating point data type (from now referred to as the custom AD data type). In terms of AD-O, the recorded data in the augmented primal run is referred to as the tape, and creating the tape is called taping. AD by overloading (AD-O) on the other hand can be applied to arbitrary code as long as operator overloading is supported by the programming language. Is connected to higher expense for the tool authors. While source transformation essentially has the potential to create more efficient code, supporting complex language features like they are available in
/iphoneuserguide-5bf1d35446e0fb00268bd320.jpg)
In general, one can divide the available software into source transformation and operator overloading tools. Vice versa, code where derivatives are computed and its respective data type and variables are called active.Ī wide collection of AD tools can be found on the community website 2. For both, tangent and adjoint, the underlying original code is called the primal, and the used floating point data type and its variables are called passive. Derivative information is then propagated through the tape in the adjoint run. In AAD, the program is first executed in the augmented primal run, where required data for later use is stored. This is done using the tangent model in tangent mode or the adjoint model in adjoint mode, where the latter is also known as adjoint AD (AAD). AD enables the computation of derivatives of the output of such programs with respect to their inputs. when performing uncertainty quantification , sensitivity analysis or shape optimization .

Derivatives of computer programs can be of interest, e.g. Linear algebra library Eigen 1 is used as a base software implementing linear algebra operations for which derivatives are to be computed using Algorithmic Differentiation (AD) by overloading.
