TorchLean API

NN.Examples.Advanced.OneSemanticUniverse

One semantic universe #

End-to-end “one semantic universe” tutorial (single graph, many semantics, one checker).

This tutorial lives under NN/Examples/Advanced because it connects execution, interval semantics, and checker soundness in one graph.

We build one medium IR graph:

x ↦ tanh(sum(Linear2(ReLU(Linear1(x)))))

and then:

  1. evaluate it under multiple scalar semantics (, FP32, IEEE32Exec);
  2. run IBP under multiple interval semantics (endpoints in , FP32, IEEE32Exec with directed rounding);
  3. empirically check that evalIEEE(G,x) lies in the IBP output box for random x ∈ B;
  4. point to the Lean theorem that the Boolean checker is sound (Box.containsDecBool_sound).

Notes:

Run: lake exe torchlean one_semantic_universe --samples 50

Command-line help for the one-semantics tutorial.

Instances For
    Instances For
      def NN.Examples.Advanced.OneSemanticUniverse.Params.map {α β : Type} (f : αβ) (p : Params α) :
      Instances For

        Proof-only instantiations (typechecks) #

        These have lines ensure we can interpret the same graph under:

        They live in a propositional example, so they do not affect the executable tutorial.