TorchLean API

NN.Examples.DeepDives.OneSemanticUniverse

One semantic universe #

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

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

We build one medium IR graph:

$$ x\mapsto\tanh\!\left(\operatorname{sum} \left(\operatorname{Linear}_2(\operatorname{ReLU}(\operatorname{Linear}_1(x)))\right)\right) $$

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\in 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.DeepDives.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.