Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

tramdag: Interpretable Neural Causal Models (TRAM-DAGs) in PyTorch

Open the demo in Colab PyPI CI License: MIT

TRAM-DAGs model each variable of a structural causal model with a monotone normalizing flow, the statistician's transformation model. The whole model is one triangular normalizing flow from iid standard-logistic latents to the observed variables. Its triangular structure is exactly your causal DAG. One fit on observational data answers all three rungs of Pearl's causal hierarchy: observational, interventional (the do-operator) and counterfactual (abduction). The model keeps interpretable effects: every linear-shift coefficient is a log-odds ratio, as in a classical proportional-odds model.

Beate Sick & Oliver Dürr, Interpretable Neural Causal Models with TRAM-DAGs, CLeaR 2025 (arXiv:2503.16206). This repository is the reference implementation, in PyTorch on zuko. It replicates the paper's experiments under continuous integration.

Start here

The demo notebook is the introduction. It fits the paper's bimodal benchmark, walks the three rungs, and checks every answer against analytic ground truth. It runs on CPU in a few minutes, in Colab or locally.

Install

uv add tramdag or pip install tramdag installs the package from PyPI. The plots extra (tramdag[plots]) adds matplotlib for the figures. A clone with uv sync gives the development setup (CONTRIBUTING.md).

Documentation

The documentation site publishes the guides, the executed notebooks and the API reference.

Use of AI tools

LLM coding assistants helped to develop this project. The authors reviewed all content and take responsibility for it.

Citation

If you use tramdag, please cite the method paper:

@inproceedings{sick2025tramdag,
  title     = {Interpretable Neural Causal Models with {TRAM-DAGs}},
  author    = {Sick, Beate and D{\"u}rr, Oliver},
  booktitle = {Proceedings of the 4th Conference on Causal Learning and Reasoning (CLeaR)},
  series    = {Proceedings of Machine Learning Research},
  volume    = {275},
  pages     = {606-630},
  year      = {2025},
  eprint    = {2503.16206},
  url       = {https://arxiv.org/abs/2503.16206},
}

Metadata

Release files for tramdag 1.0.0rc3

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

Source distribution (sdist)

Source distribution for tramdag 1.0.0rc3
File Size Uploaded Provenance Actions
tramdag-1.0.0rc3.tar.gz 70.9 kB With provenance Details for tramdag-1.0.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tramdag 1.0.0rc3
File Interpreter ABI Platform Actions
tramdag-1.0.0rc3-py3-none-any.whl Python 3 none any Details for tramdag-1.0.0rc3-py3-none-any.whl

Total release size: 149.5 kB

Release files / tramdag-1.0.0rc3.tar.gz

Download URL tramdag-1.0.0rc3.tar.gz
Size 70.9 kB
Tags Source
SHA-256 checksum
How to use checksums
86361c4dd686f3f2cfda2e6d7afd3e88698492ff1207f2cb4cf7a73627728efc
BLAKE2b-256 checksum
How to use checksums
c76f06dccdb4c050b6ed98fba285a44a01796ca47067d89067f344b348370823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / tramdag-1.0.0rc3-py3-none-any.whl

Download URL tramdag-1.0.0rc3-py3-none-any.whl
Size 78.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed77ec39c96fef4a3670b4f4d038ff571ed35f02a959ee1fcd5089a28dcabc59
BLAKE2b-256 checksum
How to use checksums
33d0839daa69aebd4ee36b0158d6f61d4caa6f4eb2dd0639baebe017bf5b247d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for tramdag 1.0.0rc3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tramdag-1.0.0rc3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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