Flattened interval bounds (FlatBox) #
FlatBox α is a small container for interval bounds on a flattened tensor value.
It is used by the graph-based LiRPA/CROWN development (NN.MLTheory.CROWN.Graph) and by some
operator-level transfer rules that operate on flattened vectors (e.g. slice/reduce rules).
dim is the flattened size, and lo/hi are tensors of shape .dim dim .scalar.
Flattened interval bounds.
dim is the flattened size (number of scalar components).
- dim : ℕ
Flattened output dimension.
- lo : Spec.Tensor α (Spec.Shape.dim self.dim Spec.Shape.scalar)
- hi : Spec.Tensor α (Spec.Shape.dim self.dim Spec.Shape.scalar)
Instances For
def
NN.MLTheory.CROWN.FlatBox.getScalar
{α : Type}
{n : ℕ}
(t : Spec.Tensor α (Spec.Shape.dim n Spec.Shape.scalar))
(i : Fin n)
:
α
Extract the scalar entry at index i from a flat vector tensor.
Instances For
def
NN.MLTheory.CROWN.FlatBox.ofTensor
{α : Type}
[Context α]
{n : ℕ}
(t : Spec.Tensor α (Spec.Shape.dim n Spec.Shape.scalar))
:
FlatBox α
Build a singleton FlatBox from an exact vector tensor t (set lo = hi = t).
Instances For
theorem
NN.MLTheory.CROWN.FlatBox.valid_ofTensor
{α : Type}
[Context α]
[Preorder α]
{n : ℕ}
(t : Spec.Tensor α (Spec.Shape.dim n Spec.Shape.scalar))
:
A singleton flat box is always valid (over any preorder).