This Julia package implements Bayesian Sum-Product Networks and infinite mixtures of Bayesian Sum-Product Networks. 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.
Note that this package requires Julia version >= 1.0.
To install the package and run the provided code, make sure to first install Julia from JuliaLang.org.
After starting Julia, you can install the package using Julia's internal package manager.
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
.
To install the package, run the following command:
pkg> add https://github.com/trappmartin/BayesianSumProductNetworks.git
All dataset and predictions can be found under: download
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.
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.
The package implements Bayesian Sum-Product Networks using the following types:
RegionGraphNode{<:Real} <: AbstractRegionGraphNode
PartitionGraphNode <: AbstractRegionGraphNode
FactorizedDistributionGraphNode <: AbstractRegionGraphNode
FactorizedMixtureGraphNode <: AbstractRegionGraphNode
InfiniteSumNode
NormalInverseGamma <: Distribution
DirichletSufficientStats <: AbstractSufficientStats
NormalInvGammaSufficientStats <: AbstractSufficientStats
GammaSufficientStats <: AbstractSufficientStats
BetaSufficientStats <: AbstractSufficientStats
For Bayesian inference the following functions are implemented:
randomscopes!
templateRegion
templatePartition
ancestralsampling!
gibbssamplescopes!
slicesample!
logpdf
logpdf!
logmllh!
The code is licensed under MIT License.
Please cite this work if you use it using the following CITATION.
This project received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie Grant Agreement No. 797223 (HYBSPN).