Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic circuits structure learner algorithms #140

Open
mattShorvon opened this issue Jan 17, 2025 · 2 comments
Open

Deterministic circuits structure learner algorithms #140

mattShorvon opened this issue Jan 17, 2025 · 2 comments

Comments

@mattShorvon
Copy link

Hi guys

Hope you're well! I've noticed that in previous versions of this package there were functions for learning the structure of deterministic circuits. In particular, you could use the learn_chow_liu_tree_circuit() function to (I think) learn a chow liu tree that you could then compile into a circuit with struct_learn() or learn_circuit(). I think struct_learn() with the right heuristic specified implemented the strudel algorithm (saw it used here https://github.com/Tractables/JuiceExamples/blob/master/Juice-Example.ipynb), but not quite sure what learn_circuit() did (saw it used here https://github.com/UCLA-StarAI/Tractable-PC-Regularization/blob/main/deterministic%20PCs/learn_strudel.jl).

My question is, am I correct in saying that these aren't implemented in the latest version of this package? I haven't seen them anywhere, but may not have looked in the right places. If so, are there other functions or approaches in this package for learning the structure of deterministic circuits? Or will this be in a later version? Thanks for your help!

Kind regards

Matt

@khosravipasha
Copy link
Contributor

Hi Matt,

tldr; I think easiest option is to use an older version of the library (v0.3.3), more details below:

Yes, you are correct, in the latest version of the library we don't have an equivalent to strudel or structure learning for deterministic circuits. When we refactored the library (for above v0.4) we were not actively using strudel structures (as HCLT performed much better at the time), and IIRC there was a small dependency/compatibility issue so we did not migrate them.

The demo notebook you shared also is using v0.3.3 from what I see, so if you install that could try to see if that works for you. ProbabilisticCircuits.jl version v0.3.3 has some structure learning options available would be see the older docs here for example:

And if you learn the circuits using v0.3.3 and save them to file (*.jpc format) should be able to load them back in the library in latest version (to get the benefits of new version, much faster inference on GPUs, etc)

===
For UCLA-StarAI/Tractable-PC-Regularization I am not too familiar with the code and not sure what version of library was used maybe can try it with 0.3.3 to see if it works.

@mattShorvon
Copy link
Author

Hi Pasha

Thanks for your help! I've got an old version of the package up and running so I'll give it a go. Really useful to know that I can save a learned circuit and load it up in with the latest version, so thanks for telling me that.

Kind regards

Matthew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants