This is a Julia library accompanying the KUL course Uncertainty in Artificial Intelligence.
- Generating pseudo random, normalized tensors.
- Testing normalization of a tensor.
- Normalizing tensors overall.
- Normalizing tensors with a condition set.
- Plotting (factor) graphs, (Hidden) Markov Models, (di)graphical models, Bayesian Networks
- Mermaid-JS like easy, human-and-machine readable graphical model construction. e.g.:
- c is a collider of a and b
a>c<b
a-b-c
is a linear (Markov) chain
- c is a collider of a and b
- Get factorisation from graphical model.
getFactorization("a<f>b")
P(a,f,b) =
(P(a|f)P(f)P(b|f), DiscreteVar[a, f, b])
- Mixed model (Chain Graph) representations e.g.
a-b-c; e<b>d
is a mixed model with a fork extending from b. - Testing for graphical independence in Bayesian networks (D-seperation)
julia> @gidp "a<c>b" a b|c
a ⫫ b | c
true
julia> @gidp "a>c<b" a b|c
a ⫫⃥ b | c
false
- Interactive adding of probability tables see examples/simple.ipynb
You can get Julia 1.4 here.
You can install this library in two different ways either by forking or using the Julia build-in Pkg package manager.
git clone https://github.com/KULeuven-MAI/UAI.jl
cd UAI.jl
julia
# enter the package manager with ]
] activate .
instantiate
# back to regular Julia REPL
<backspace>
using UAI
# precompiled and all set for e.g. this:
plotFromStr("a>c<b", "plots/collider.png")
import Pkg
Pkg.add(Pkg.PackageSpec(url="https://github.com/KULeuven-MAI/UAI.jl"))
using UAI
drawFromStr("a>c<b", "plots/collider.png")
If you're using Jupyter notebooks with the IJulia kernel you can include display the generated png simply by using the following markdown syntax:
![](plots/collider.png)
I warmly welcome contributions. Julia is a pleasure to work with imho, increasing in popluarity, ready for high performance computing and used more and more in the Data Science community. An ideal choice to try it with this project. :)
I'm trying to write extensive tests you can run those as follows:
git clone https://github.com/KULeuven-MAI/UAI.jl
cd UAI.jl
] test
If you create a PR, please make sure the test are succeeding, fix them if necessary. (But I still have some catching up to do with writing tests. See #3)
plotFromStr("a>c<b", "plots/collider.png")
plotFromStr("a<f>b", "plots/fork.png")
plotFromStr("a>b>c", "plots/chain.png")
plotFromStr("a-b-c-d-a", "plots/grid.png")
drawFromStr("e<a-b-c-d>e;d-a", "plots/chainGraph.png")
- Displaying chain graphs is possible with my GraphPlot fork (until this PR)
- Cleaner APIs and better documentation.
- Inference with bucket elimination.
- Inference with various algorithms: naive sum-prodcut, bucket elimination, sum-product algorithm on factor graphs, alpha/beta inference for HMMs
- Benchmark comparison of the implemented inference algorithms.
- (Full Information) Maximum Likelihood implementation for Missing At Random data.
- Tools for step-by-step probabilistic reasoning: application of definitions, Bayes rule, pushing sums down, ...
- Soft logic gates tool
- Implement Plots.jl and GraphRecipes as visual backend instead of GraphPlot.jl.
- (Interactive?) Visualization of the simplified sum-product algorithm for non-branching graphs
- (Interactive?) Visualization of the (Sum|Max)-Product algorithm
- Interactive and visualized probabilistic problem solving challenges.
- SVG support for drawFromStr() (see #1)
- Make documentation cheatsheet corresponding to this one here
- < Your suggestion here >
- Multi-node support like
A,B>C
(see #2) - Plate notation
- Integration of this paper and other math-visual tools
- Integration with Probabilistic Programming Language Turing.jl?
- Accessibility (for ease of education with dyslexia, colorblindness, dyspraxia, ...)
- Displaying matrices & vectors beautifully (useful for visualizing algorithms)
- < Your suggestion here >