Skip to main content

Module ad

Module ad 

Source
Expand description

The interface for automatic differentiation.

Differentiation follows JAX: forward mode applies each primitive’s JVP rule (Primitive::jvp), which computes the tangents of the outputs with operations that are linear in the tangents of the inputs; reverse mode linearizes (JVP followed by partial evaluation, which separates the primal computation from the linear tangent computation) and transposes the linear part with each primitive’s transpose rule (Primitive::transpose). Rules emit operations through AdCx; the drivers live in ruxla-transforms.

Enums§

TransposeInput
An input of a primitive being transposed.

Traits§

AdCx
A context that emits the operations of a differentiated function.

Functions§

is_differentiable
Whether values of an abstract value have (nonzero) tangents: only floats and complex numbers do; tangents of integers and booleans are always zero.

Type Aliases§

AdBuildBody
The body given to AdCx::build_function.
Tangent
A tangent or a cotangent: None is a symbolic zero, which rules skip instead of computing with zeros.