https://github.com/probmods/webppl
Tip revision: cfdee3b6c0065b0ec7cc5d9e1552e5f7f09bc1ed authored by Andreas Stuhlmueller on 06 June 2017, 22:14:47 UTC
0.9.9
0.9.9
Tip revision: cfdee3b
usage.rst
Usage
=====
.. highlight:: none
Running WebPPL programs::
webppl examples/geometric.wppl
Arguments
---------
Seeding the random number generator::
webppl examples/lda.wppl --random-seed 2344512342
Compiling WebPPL programs to JavaScript::
webppl examples/geometric.wppl --compile --out geometric.js
The compiled file can be run using nodejs::
node geometric.js
Passing arguments to the program
--------------------------------
Command line arguments can be passed through to the WebPPL program by
placing them after a single ``--`` argument. Such arguments are parsed
(with `minimist <https://www.npmjs.com/package/minimist>`_) and the
result is bound to the global variable ``argv``.
For example, this program::
display(argv);
When run with::
webppl model.wppl -- --my-flag --my-num 100 --my-str hello
Will produce the following output::
{ _: ['model.wppl'], 'my-flag': true, 'my-num': 100, 'my-str': 'hello' }