ランキングに戻る

TuringLang/Turing.jl

Juliaturinglang.org

Bayesian inference with probabilistic programming.

machine-learningprobabilistic-programmingjulia-languageartificial-intelligencebayesian-inferencehamiltonian-monte-carloturingbayesian-statisticsmcmchmcprobabilistic-graphical-modelsprobabilistic-models
スター成長
スター
2.2k
フォーク
241
週間成長
Issue
21
1k2k
2016年5月2019年9月2023年2月2026年7月
README

Turing.jl logo

Bayesian inference with probabilistic programming

Tutorials API docs Tests Code Coverage ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

[!IMPORTANT] Turing.jl is maintained primarily by academic researchers at grant-funded institutions, with correspondingly limited capacity for triage and review.

Turing.jl's preferred automatic differentiation backends are ForwardDiff.jl and Mooncake.jl, which are supported natively through their public APIs; further backends are available via DifferentiationInterface.jl.

If you would like to contribute, we ask that proposals for new features be submitted first, so that the TuringLang team can indicate whether they are a good fit before implementation begins; bug fixes and small changes are very welcome as pull requests directly. Reviewer privileges are reserved for those with a sustained record of substantive contributions to TuringLang, or for individuals explicitly invited by a team member.

Get started

Install Julia (see the official Julia website; you will need at least Julia 1.10.8 for the latest version of Turing.jl). Then, launch a Julia REPL and run:

julia> using Pkg; Pkg.add("Turing")

You can define models using the @model macro, and then perform Markov chain Monte Carlo sampling using the sample function:

julia> using Turing

julia> @model function linear_regression(x)
           # Priors
           α ~ Normal(0, 1)
           β ~ Normal(0, 1)
           σ² ~ truncated(Cauchy(0, 3); lower=0)

           # Likelihood
           μ = α .+ β .* x
           y ~ MvNormal(μ, σ² * I)
       end

julia> x, y = rand(10), rand(10)

julia> posterior = linear_regression(x) | (; y = y)

julia> chain = sample(posterior, NUTS(), 1000)

You can find the main TuringLang documentation at https://turinglang.org, which contains general information about Turing.jl's features, as well as a variety of tutorials with examples of Turing.jl models.

API documentation for Turing.jl is specifically available at https://turinglang.org/Turing.jl/stable.

Contributing

Issues

If you find any bugs or unintuitive behaviour when using Turing.jl, please do open an issue! Please don't worry about finding the correct repository for the issue; we can migrate the issue to the appropriate repository if we need to.

Pull requests

We are of course also very happy to receive pull requests. If you are unsure about whether a particular feature would be welcome, you can open an issue for discussion first.

When opening a PR, non-breaking releases (patch versions) should target the main branch. Breaking releases (minor version) should target the breaking branch.

If you have not received any feedback on an issue or PR for a while, please feel free to ping @TuringLang/maintainers in a comment.

Other channels

The Turing.jl userbase tends to be most active on the #turing channel of Julia Slack. If you do not have an invitation to Julia's Slack, you can get one from the official Julia website.

There are also often threads on Julia Discourse (you can search using, e.g., the turing tag).

What's changed recently?

We publish a fortnightly newsletter summarising recent updates in the TuringLang ecosystem, which you can view on our website, GitHub, or Julia Slack.

For Turing.jl specifically, you can see a full changelog in HISTORY.md or our GitHub releases.

Where does Turing.jl sit in the TuringLang ecosystem?

Turing.jl is the main entry point for users, and seeks to provide a unified, convenient interface to all of the functionality in the TuringLang (and broader Julia) ecosystem.

In particular, it takes the ability to specify probabilistic models with DynamicPPL.jl, and combines it with a number of inference algorithms, such as:

Citing Turing.jl

If you have used Turing.jl in your work, we would be very grateful if you could cite the following:

Turing.jl: a general-purpose probabilistic programming language
Tor Erlend Fjelde, Kai Xu, David Widmann, Mohamed Tarek, Cameron Pfiffer, Martin Trapp, Seth D. Axen, Xianda Sun, Markus Hauru, Penelope Yong, Will Tebbutt, Zoubin Ghahramani, Hong Ge
ACM Transactions on Probabilistic Machine Learning, 2025 (Just Accepted)

Turing: A Language for Flexible Probabilistic Inference
Hong Ge, Kai Xu, Zoubin Ghahramani
Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, PMLR 84:1682-1690, 2018.

Expand for BibTeX
@article{10.1145/3711897,
author = {Fjelde, Tor Erlend and Xu, Kai and Widmann, David and Tarek, Mohamed and Pfiffer, Cameron and Trapp, Martin and Axen, Seth D. and Sun, Xianda and Hauru, Markus and Yong, Penelope and Tebbutt, Will and Ghahramani, Zoubin and Ge, Hong},
title = {Turing.jl: a general-purpose probabilistic programming language},
year = {2025},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3711897},
doi = {10.1145/3711897},
note = {Just Accepted},
journal = {ACM Trans. Probab. Mach. Learn.},
month = feb,
}

@InProceedings{pmlr-v84-ge18b,
  title = 	 {Turing: A Language for Flexible Probabilistic Inference},
  author = 	 {Ge, Hong and Xu, Kai and Ghahramani, Zoubin},
  booktitle = 	 {Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics},
  pages = 	 {1682--1690},
  year = 	 {2018},
  editor = 	 {Storkey, Amos and Perez-Cruz, Fernando},
  volume = 	 {84},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {09--11 Apr},
  publisher =    {PMLR},
  pdf = 	 {http://proceedings.mlr.press/v84/ge18b/ge18b.pdf},
  url = 	 {https://proceedings.mlr.press/v84/ge18b.html},
}
関連リポジトリ
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

C++Apache License 2.0tensorflowmachine-learning
tensorflow.org
196.4k75.6k
f/prompts.chat

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

HTMLOtherchatgptai
prompts.chat
166.1k21.5k
huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

PythonPyPIApache License 2.0nlpnatural-language-processing
huggingface.co/transformers
162.8k34k
pytorch/pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

PythonPyPIOtherneural-networkautograd
pytorch.org
101.8k28.4k
rasbt/LLMs-from-scratch

Implement a ChatGPT-like LLM in PyTorch from scratch, step by step

Jupyter NotebookOthergptlarge-language-models
amzn.to/4fqvn0D
99.5k15.3k
microsoft/ML-For-Beginners

12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all

Jupyter NotebookMIT Licensemldata-science
88.4k21.6k
Developer-Y/cs-video-courses

List of Computer Science courses with video lectures.

computer-sciencealgorithms
82.6k11.4k
mlabonne/llm-course

Course to get into Large Language Models (LLMs) with roadmaps and Colab notebooks.

Apache License 2.0coursellm
mlabonne.github.io/blog/
81.1k9.5k
netdata/netdata

The fastest path to AI-powered full stack observability, even for lean teams.

GoGo ModulesGNU General Public License v3.0monitoringdocker
netdata.cloud
79.8k6.5k
d2l-ai/d2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

PythonPyPIApache License 2.0deep-learningbook
zh.d2l.ai
79.1k12.3k
tesseract-ocr/tesseract

Tesseract Open Source OCR Engine (main repository)

C++Apache License 2.0tesseracttesseract-ocr
tesseract-ocr.github.io
75.5k10.7k
binhnguyennus/awesome-scalability

The Patterns of Scalable, Reliable, and Performant Large-Scale Systems

MIT Licensesystem-designbackend
72.6k7k