TorchLean API

NN.Proofs.RuntimeApprox.Graph.LinkAutogradAlgebra

Link Proofs.RuntimeApprox.RevGraph to the executable Proofs.Autograd.Algebra.GraphData #

This is a definitional/structural bridge:

Both sides use TorchLean.TensorPack directly, so the bridge does not convert between different context representations.

Note on environments (Δ): Proofs.Autograd.Algebra.GraphData is parameterized by an extra (non-differentiable) environment Δ threaded through evaluation. The runtime-approximation graphs here do not use such an environment, so we instantiate the executable layer at Δ := Unit and pass () during evaluation/backprop.

Erase a RuntimeApprox.RevNode into an executable Autograd.Algebra.NodeData.

We take Δ := Unit (no extra environment) and ignore the JVP input, since this bridge is only used for forward evaluation and VJP-based backprop.

Instances For

    Erase a RuntimeApprox.RevGraph into executable Autograd.Algebra.GraphData (with Δ := Unit).

    This forgets all spec/bound metadata and keeps only the runtime forward and vjp closures.

    Instances For

      Erasing a RevGraph into executable GraphData preserves the runtime forward semantics.

      Informally: if you forget the spec and bound metadata and keep only the runtime closures, you still evaluate to the same runtime context.

      Erasing a RevGraph into executable GraphData preserves the runtime backward semantics.

      Informally: the executable GraphData.backpropCtx computes the same reverse-mode accumulation as RevGraph.backpropRuntime when given the same runtime input context and seed cotangents.