AMOR REPORT 2005/01 Source Transformation for MATLAB Automatic Differentiation
نویسندگان
چکیده
This report describes MSAD, a tool that applies source transformation automatic differentiation to MATLAB programs involving arbitrary vector-valued functions. The transformed programs compute both the results of the original program and the first derivatives. The current version of MSAD performs a complete source transformation for the forward mode of AD by specialising and inlining operations from the fmad and derivvec classes of the MAD package. This implementation benefits by eliminating overheads due to operator overloading in MAD while preserving the optimised derivative combination operations from the derivvec class. MSAD also inherits from MAD the use of MATLAB’s sparse data-type to propagate directional derivatives. To aid the process of specialising routines during differentiation, a simple forward activity, shape and type propagation mechanism is used. Compared to MAD and the previous hybrid of source transformation and operator overloading approach in MSAD, we find a marked improvement in derivative computations using source transformation, even on large problem sizes. On most smaller problems we observe an order of magnitude savings over MAD. We have also tested the tool on several problems from the MINPACK-2, MATLAB ODE/optimisation and CWI IVP test suites, some of these results are presented here.
منابع مشابه
A A Source Transformation via Operator Overloading Method for the Automatic Differentiation of Mathematical Functions in MATLAB
Automatic differentiation, or as it has more recently been termed, algorithmic differentiation, (AD) is the process of determining accurate derivatives of a function defined by computer programs [Griewank 2008] using the rules of differential calculus. The objective of AD is to employ the rules of differential calculus in an algorithmic manner in order to efficiently obtain a derivative that is...
متن کاملSensitivity Analysis and Design Optimization through Automatic Differentiation
Automatic, or algorithmic, differentiation (AD) is a technique for transforming a program or subprogram that can be interpreted as computing a mathematical function, including arbitrarily complex simulation codes, into one that computes the derivatives of that function. We describe the implementation and application of automatic differentiation tools. We highlight recent advances in the combina...
متن کامل"To be recorded" analysis in reverse-mode automatic differentiation
The automatic generation of adjoints of mathematical models that are implemented as computer programs is receiving increased attention in the scientific and engineering communities. Reverse-mode automatic differentiation is of particular interest for large-scale optimization problems. It allows the computation of gradients at a small constant multiple of the cost for evaluating the objective fu...
متن کاملA Source-level MATLAB Transformer for DSP Applications
We present an automatic source-level transformer for DSP applications written in MATLAB. Our transformer is based on a novel approach to specify the transformations in an XML-based language resulting in a simple implementation of the transformer as a rewriting engine. In an earlier study we have identified transformations that pay off handsomely for DSP applications. This paper describes the d...
متن کاملTransformation of C code to Matlab / Simulink models
1.1. Motivation In the modern development process of automotive embedded software, the graphical executable specification is becoming to take the place of the textual specification and accepted by both the manufactures and suppliers. There are advantages such as easy understanding and communication, fast development with executable specification in modeling and simulation tools, and automatic c...
متن کامل