Skip to main content

a lightweight interface to the TensorFlow Probability backend of the Stan compiler.

Project description

Stan2tfp

The new Stan compiler features a TensorFlow Probability backend, transpiling Stan programs to python code.

stan2tfp is a lightweight interface wrapper around this functionality, allowing users to:

  • call the compiler (emitting TFP code)
  • run the code (creating a model object in the current namespace)
  • sample the model (using TFP's NUTS)

... without leaving the notebook or their favorite IDE.

The new compiler and the TFP backend are under active development. Currently only a small subset of Stan's functionality is supported. For a list of supported distributions, see here.

Install

stan2tfp is a pure-Python package which can be installed from PyPI

pip install stan2tfp

This will also install TensorFlow and TensorFlow Probability (both in nightly version; needed for XLA compilation of the model).

stan2tfp provides the function download_stan2tfp_compiler which downloads a pre-compiled binary of the compiler. By default it installs the latest version into the same directory as the package itself. A different path or a different version of the compiler can be specified.

"Hello world"

For a simple end-to-end example of using stan2tfp, see here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stan2tfp-0.1.0a0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

stan2tfp-0.1.0a0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file stan2tfp-0.1.0a0.tar.gz.

File metadata

  • Download URL: stan2tfp-0.1.0a0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1.post20200515 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.10

File hashes

Hashes for stan2tfp-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 4b540c670e3ec7bb79a04ce6711ffe28910ad710970d9982384c5da11fd4015b
MD5 c621d1f586335db20531e6e037f36de5
BLAKE2b-256 817df836df08bd4f464cd588955bff06df531224606369310c8522821b7219d3

See more details on using hashes here.

File details

Details for the file stan2tfp-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: stan2tfp-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1.post20200515 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.10

File hashes

Hashes for stan2tfp-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 113e15dde88fba0988e819c45305d7c0b2e769473ae05304146dbce463f4bb77
MD5 e5a9d8538af7a5f853429ec9015eed58
BLAKE2b-256 c88154af3caaf592fadcb0d3f5bd3a75203e584149fb6d522b294c3dc77345cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page