probsys / sppl

Probabilistic programming system for fast and exact symbolic inference
Apache License 2.0
76 stars 10 forks source link

Implement command line interface? #110

Open fsaad opened 3 years ago

fsaad commented 3 years ago

It could be useful to have a Python command-line interface for SPPL, i.e.,

$ pyhton -m sppl compile <model.py> # produces model.spe
$ python -m sppl logprob <model.spe> <expression>
$ python -m sppl condition <model.spe> <expression>
$ python -m sppl logpdf <model.spe> <dict>
$ python -m sppl constrain <model.spe> <dict>

One downside is that the SPE does not remain in memory, negating the benefits of computation reuse and closue under conditioning.

A parallel option is to provide a simple API for the Python shell in sppl.__init__.py, analogously to the one used in magics.py.