Code Generation for Gradients and Hessians Using Symbolic AD

This package provides symbolic automatic differentiation tools for efficient code generation of gradients and Hessians.

Al momento, stai seguendo questo contributo

This package contains functions for performing symbolic automatic differentiation to efficiently generate code for gradient and Hessian expressions. It relies on Matlab’s Symbolic Math Toolbox, which must be available.
The examples "Example1" and "Example2" demonstrate how the automatic differentiation works, both with and without simplification of expressions. The corresponding scripts "Example1toC" and "Example2toC" show how to generate C code from the resulting expressions. The generated code can then be compiled into executable functions, as illustrated in the scripts "testExampleFun1", "testExampleFun2", and "testExampleFun1Fun2".
A C compiler must be installed for this step, see the Matlab documentation on mex.
There is also support for generating Hessians in sparse matrix format with block structure, demonstrated in "ExampleCameraEstimation1" and "ExampleCameraEstimation2". Generating this code takes longer due to the larger size and complexity of the symbolic expressions.

Cita come

Per Bergström (2026). Code Generation for Gradients and Hessians Using Symbolic AD (https://it.mathworks.com/matlabcentral/fileexchange/180850-code-generation-for-gradients-and-hessians-using-symbolic-ad), MATLAB Central File Exchange. Recuperato .

Add the first tag.

Informazioni generali

Compatibilità della release di MATLAB

  • Compatibile con qualsiasi release

Compatibilità della piattaforma

  • Windows
  • macOS
  • Linux
Versione Pubblicato Note della release Action
1.0.0