Module autodiff

Source
Expand description

The autodiff module.

Modules§

accumulate
Accumulate trait. Reverse accumulation trait. This trait is used to reverse accumulate the gradient for different types.
gradient
Implements the gradient computation. This module contains the Gradient trait. Each implementation of wrt returns the chosen partial derivatives.
graph
The Graph (aka. tape or Wengert List). This module contains the implementation of the computation Graph. The graph is also known as a Wengert List.
graphviz
Visualisation of the Graph. This module is for visualising a Graph.
overload
Operator/function overloading. This module contains the overloaded operators and primitive functions. In Griewank and Walther - Evaluating Derivatives, they refer to this as the “elemental library”. Operations such as + and * are redefined, along with primitive functions such as sin, exp, and log. Each overload has an associated test to ensure functionality.
variable
Variables for autodiff. This module contains the implementation of the Variable structure.
vertex
Implements Vertex (nodes) for the Graph.

Structs§

Graph
Struct to contain the graph (Wengert list), as a vector of Vertexs.
Variable
Struct to contain the initial variables.
Vertex
Struct defining the vertex of the computational graph.

Enums§

Arity
Enumeration for the operation type. This is used to determine the number of parents. For example: - A binary operation has two parents. - A unary operation has one parent. - A nullary operation has no parents.

Traits§

Accumulate
Trait to reverse accumulate the gradient for different types.
Gradient
Return the derivative/s with-respect-to the chosen variables. This allows you to get the gradient of a function with respect to any selection of variables, i.e. - a single variable, - a subset of the variables, - or all of the variables.
Log
Overload the Log trait.
Max
Overload the Max trait.
Min
Overload the Min trait.
Powf
Overload the Powf trait.
Powi
Overload the Powi trait.

Functions§

graphviz
Graphviz dot string.