Skip to main content

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.

Release files for stan2tfp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stan2tfp 0.1.1
File Size Uploaded
stan2tfp-0.1.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stan2tfp 0.1.1
File Interpreter ABI Platform
stan2tfp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / stan2tfp-0.1.1.tar.gz

Download URL stan2tfp-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
64b2803c55b163a594adf28284234590aefe453940bb54587f81f20a1a749dec
BLAKE2b-256 checksum
How to use checksums
72ee4b82cf0acc3bb4918f53f8a7c5b74a1246e603dacde003652907d4a41bce
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / stan2tfp-0.1.1-py3-none-any.whl

Download URL stan2tfp-0.1.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5adec1176ae4d74c0958416c75f066d8096344735f646d85e013581d8ac905b2
BLAKE2b-256 checksum
How to use checksums
629886b115c4ea1e788fb4cc490e3895c30e4a06f220b24131ac25327ee3d4c3
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page