Tractables / ProbabilisticCircuits.jl

Probabilistic Circuits from the Juice library
https://tractables.github.io/ProbabilisticCircuits.jl/dev
Apache License 2.0
105 stars 11 forks source link

Non-literal leaves #58

Closed RenatoGeh closed 2 years ago

RenatoGeh commented 3 years ago

Hi,

How can we extend Juice to non-literal leaves (more specifically categorical distributions)? As we push towards more complex domains, we end up having to sparse data more and more if we keep using only literals. I'm not too familiar with how queries are evaluated internally, but I'm guessing it's not as easy as just extending a StructProbLeafNode. Maybe we should delegate computation of each node to its own function instead of handling everything within each inference function? How do you guys feel about this? If you guys could give me some pointers where to start I'd be happy to submit a PR with the changes.

Thanks

guyvdbroeck commented 3 years ago

I agree this is high priority, also for supporting continuous distributions. The changes should not be too crazy. Most inference algorithms can abstract away the 'special function' to be applied at the input layer. First step would probably be to have ProbabilisticCircuit not inherit from LogicCircuit anymore, introduce a support function that maps a ProbabilisticCircuit to a LogicCircuit when the vocabulary happens to be Boolean. Fixing the bugs and missing functionality stemming from that change could take a while. The the second step would be to have a generic ProbabilisticLeaf struct which has its own EVI, MAR, MAP function.

arranger1044 commented 3 years ago

I totally agree! Since it sounds like a nice big refactoring, I take the opportunity to suggest adopting the modern nomenclature we are using now (inputs/ouputs/feedforward, instead of leaves/parent/children/bottomup...) but more crucially, the representational abstraction from the Compositional Atlas -> https://arxiv.org/abs/2102.06137 That is, we just need an abstraction for general Circuits with arbitrary leaves, then ProbabilisticCircuits are a natural subclass. LogicCircuits belong to a different branch of the hierarchy (no dependencies), but it will always be possible to turn a deterministic logical circuit into a ProbabilisticCircuit (and hence a Circuit).

khosravipasha commented 2 years ago

V0.4 in the master now suports non-literal leaves, documentation and examples coming soon.