|
| 1 | +# Bayesian Sum-Product Networks |
| 2 | + |
| 3 | +This Julia package implements Bayesian Sum-Product Networks and infinite mixtures of Bayesian Sum-Product Networks. |
| 4 | +Besides all necessary core routines, this package additionally implements approximate Bayesian inference using a combination of ancestral and Gibbs sampling as well as an implementation of the distributed slice sampler for infinite mixtures of SPNs. |
| 5 | + |
| 6 | +Note that this package requires Julia version >= 1.0. |
| 7 | + |
| 8 | +To install the package and run the provided code, make sure to first install Julia from [JuliaLang.org](https://julialang.org/downloads/). |
| 9 | + |
| 10 | +After starting Julia, you can install the package using Julia's internal package manager. |
| 11 | +To do so, press `]` within the Julia command line to switch to the package manager prompt. You can leaf the package manager by pressing `BACKSPACE`. |
| 12 | + |
| 13 | +To install the package, run the following command: |
| 14 | +```julia |
| 15 | +pkg> add https://github.com/trappmartin/BayesianSumProductNetworks.git |
| 16 | +``` |
| 17 | + |
| 18 | +### Dataset and Predictions |
| 19 | +All dataset and predictions can be found under: [download](https://github.com/trappmartin/BayesianSumProductNetworks/releases/download/v1.0.0/data_predictions_scripts.tar) |
| 20 | + |
| 21 | +### Running Experiments |
| 22 | +To run the experiments, start the respective shell script located in the `hpc` folder. Those scripts are written such that they can be used as master scripts for slurm jobs. |
| 23 | + |
| 24 | +### API |
| 25 | +All types and functions listed here contain doc-strings. Therefore, if you are interest in more details please about the use of those functions/types please use Julia's internal documentation system. Therefore, press `?` within the Julia command line and then enter the name of the function/type you want to know more about. |
| 26 | + |
| 27 | +The package implements Bayesian Sum-Product Networks using the following types: |
| 28 | + |
| 29 | +```julia |
| 30 | +RegionGraphNode{<:Real} <: AbstractRegionGraphNode |
| 31 | +PartitionGraphNode <: AbstractRegionGraphNode |
| 32 | +FactorizedDistributionGraphNode <: AbstractRegionGraphNode |
| 33 | +FactorizedMixtureGraphNode <: AbstractRegionGraphNode |
| 34 | +InfiniteSumNode |
| 35 | +NormalInverseGamma <: Distribution |
| 36 | +DirichletSufficientStats <: AbstractSufficientStats |
| 37 | +NormalInvGammaSufficientStats <: AbstractSufficientStats |
| 38 | +GammaSufficientStats <: AbstractSufficientStats |
| 39 | +BetaSufficientStats <: AbstractSufficientStats |
| 40 | +``` |
| 41 | + |
| 42 | +For Bayesian inference the following functions are implemented: |
| 43 | + |
| 44 | +```julia |
| 45 | +randomscopes! |
| 46 | +templateRegion |
| 47 | +templatePartition |
| 48 | +ancestralsampling! |
| 49 | +gibbssamplescopes! |
| 50 | +slicesample! |
| 51 | +logpdf |
| 52 | +logpdf! |
| 53 | +logmllh! |
| 54 | +``` |
0 commit comments