I see inferme and gen.clj as the primary recommendations that stay in clojure for bayes.
My assumptions are that inferme is easier, and gen.clj is more powerful.
gen.clj being based on a serious project as an implementation. Appears that it would offer more power and stability... somewhat.
I wonder what would be the best entry point for learning. Maybe gen.clj because of the extra resources even if in another lang. Maybe inferme and if inferm would the migration path if I want gen.clj be much different?
I've been using Inferme and like it a lot for its clarity and simplicity. (Haven't got to learn enough about Gen.clj yet.) For bigger problems, and for cases where we need the full Bayesian ecosystem at our hands, I think cmdstan-clj is a pragmatic choice/ https://github.com/scicloj/cmdstan-clj
I think Bayesian statistics is one of those spaces where we have have pure, simple and beatiful solutions in Clojure (Inferme, Gen.clj), but at the same time, we need to be open to the richness of bigger communities. (.. just like we can train deep networks in Clojure with Deep Diamond, but still need to reach to Pytorch, etc., for existing architectures, pretrained networks, tutorials, visualizations, diagnostics, tooling, etc.) Stan, PyMC, and other Bayesian communities can offer us a lot (e.g., https://www.arviz.org/en/latest/). It will take some time till we have all that in pure Clojure. Till then, interop is actually not so bad. You may also enjoy this draft tutorial for PyMC through interop: https://scicloj.github.io/clojure-data-tutorials/projects/stats/pymc/intro
I wrote inferme as a part of my learning process of MCMC and similar stuff. I worked through some books making examples and building a library. So I think it's a good way to play with at the beginning of research in the area.
Regarding gen.clj it has background at MIT but I'm not sure if it's mature enough and what actual inference methods are implemented (I see only importance sampling).
@zane can you elaborate more about what's inside a toolkit and what are the further plans for gen.clj ?
Sure!
Love how I didn't even tag you both and you are straight in there with helpful info. 🙏clojure-spin
Gen.clj is an implementation of the https://www.gen.dev/ probabilistic programming language. Most probabilistic programming languages treat inference algorithms as general-purpose black boxes, but this approach doesn't scale well as probabilistic programs become more complex. Gen is different in that it supports programmable inference. Instead of an inference engine that tightly couples inference algorithms with language compiler details, Gen gives users a flexible API for implementing an open-ended set of inference and learning algorithms. Programmable inference scales better, but requires care and expertise on the part of the probabilistic programmer. Also, in addition to having a modeling language for writing down models using ordinary code, Gen lets users hand-code parts of their models that demand better performance.
While Gen.clj is in active use by researchers, inferme is almost certainly the more mature library. If you aren't intending to write the kind of probabilistic programs that would need Gen's unique performance-oriented features you're probably better off using inferme.
Hope that helps!
Thank you. I have not stepped into this world yet. Getting lay of the land. But I feel it coming soon as my projects and interfaces mature. Appreciate this information from both of you.
It's a deep and fascinating field! I hope you have fun exploring it.
Feel free to join us in #gen-clj if you like. I don't have much time these days to contribute to the project, but other more active contributors like @sritchie09 hang out in there. Together we'll do our best to answer any follow-up questions you might have.
Hey all! @tsulej there are no active plans to develop gen.clj… the researchers who would have done so are going to be active in the probabilistic programming world, but most folks have departed for startups over the past month, and will be working more closely with tools that give ready access to the GPU. Some of that move back to Gen.clj eventually!