Idris2Doc : Control.Monad.Distribution

Control.Monad.Distribution

(source)

Reexports

importpublic Data.Tensor

Definitions

recordDist : 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->Distnamei

Projection: 
.logits : Distnamei->Tensor [(name~~>i)] Double
  Probabilities are represented as logits

Hint: 
Show (DistaxisNamei)
.logits : Distnamei->Tensor [(name~~>i)] Double
  Probabilities are represented as logits

Totality: total
Visibility: public export
logits : Distnamei->Tensor [(name~~>i)] Double
  Probabilities are represented as logits

Totality: total
Visibility: public export
uniform : IsSucci=>Distnamei
  Logit representation of the uniform distribution

Totality: total
Visibility: public export
diracDelta : IsSucci=>Fini->Distnamei
  Logit representation of dirac delta
Note that `0` is the canonical choice, as softargmax subtracts the max

Totality: total
Visibility: public export
Dist : AxisName->Nat->Cont
  Container whose shape represents a distribution over `n` choices, and
whose position represents the choice made.

Totality: total
Visibility: public export
Simplex : 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 export
ProbabilisticChoice : AxisName->VectnAddCont->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 export
ChoiceMade : AxisName->VectnAddCont->AddCont
  The choice made: a distribution over the branches and the chosen branch's content

Totality: total
Visibility: public export
resolveByLabel : (ProbabilisticChoicedistNamebranches>*<ChoiceMadedistNamebranches) =%+> (ChoiceMadedistNamebranches>*<ChoiceMadedistNamebranches)
  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