| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Circuit.Mat.Prob
Description
Prob carrier for Mat.
A Mat r i j is a linear map from input indices i to output indices j
with weights in r. That is exactly the linear fragment of the double-dual
probability arrow Prob. This module gives the embedding that
lets a Mat construction flow through the Prob carrier with no rewrite.
Documentation
matToProb :: forall r i j. (Additive r, Multiplicative r, Eq j, Finite i, Finite j) => Mat r i j -> Prob (->) r i j Source #
Embed a semiring matrix into the Prob continuation carrier.
The resulting Prob (->) r i j is the expectation transformer:
runProb (matToProb m) k (x, i) = Σⱼ m(i,j) · k(x,j)