record Dist : AxisName -> Nat -> Type Convex combination of a finite set of types, a point in a simplex △^(i-1)
i=2 -> △¹ -> line segment
i=3 -> △² -> triangle
...
Probabilities are represented as logits, represented as a rank 1 tensor.
Because the tensor has a name, and `Dist` is a thin wrapper around it,
the name is exposed at the type level, allowing named operations to be
extended to distributions
TODO, is Dist a quotient container?
Totality: total
Visibility: public export
Constructor: MkDist : Tensor [(name ~~> i)] Double -> Dist name i
Projection: .logits : Dist name i -> Tensor [(name ~~> i)] Double Probabilities are represented as logits
Hint: Show (Dist axisName i)
.logits : Dist name i -> Tensor [(name ~~> i)] Double Probabilities are represented as logits
Totality: total
Visibility: public exportlogits : Dist name i -> Tensor [(name ~~> i)] Double Probabilities are represented as logits
Totality: total
Visibility: public exportuniform : IsSucc i => Dist name i Logit representation of the uniform distribution
Totality: total
Visibility: public exportdiracDelta : IsSucc i => Fin i -> Dist name i Logit representation of dirac delta
Note that `0` is the canonical choice, as softargmax subtracts the max
Totality: total
Visibility: public exportDist : AxisName -> Nat -> Cont Container whose shape represents a distribution over `n` choices, and
whose position represents the choice made.
Totality: total
Visibility: public exportSimplex : AxisName -> Nat -> AddCont Container whose shapes are distributions, positions their gradients.
Both are represented as logits
If we were treating this as non-logit distributions then we'd have a
one less dimension: both for the simplex in the forward pass and the
gradients in the backwards one
That is, the effective dimension of this space is n-1 (we can add a
constant to all logits without changing the answer), and there's a
direction in the gradient logit space that does not affect output
Totality: total
Visibility: public exportProbabilisticChoice : AxisName -> Vect n AddCont -> AddCont A distribution over `n` branches together with, contingent on a choice made
by the environment, the chosen branch's content
TODO do we think of distr. on the fw pass as being part of Simplex or Nap?
Totality: total
Visibility: public exportChoiceMade : AxisName -> Vect n AddCont -> AddCont The choice made: a distribution over the branches and the chosen branch's content
Totality: total
Visibility: public exportresolveByLabel : (ProbabilisticChoice distName branches >*< ChoiceMade distName branches) =%+> (ChoiceMade distName branches >*< ChoiceMade distName branches) Resolve probabilistic choice through the ground truth label. The labelled
branch is selected, and its gradient goes back as a singleton bag
TODO do we need the right component of the codomain?
Totality: total
Visibility: public export