https://github.com/boisgera/pioupiou
Pioupiou 🐤, the nano PPL
https://github.com/boisgera/pioupiou
programming python random
Last synced: 3 months ago
JSON representation
Pioupiou 🐤, the nano PPL
- Host: GitHub
- URL: https://github.com/boisgera/pioupiou
- Owner: boisgera
- License: mit
- Created: 2021-02-24T12:00:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T19:58:34.000Z (about 3 years ago)
- Last Synced: 2025-03-18T22:22:50.489Z (3 months ago)
- Topics: programming, python, random
- Language: Python
- Homepage: https://boisgera.github.io/pioupiou
- Size: 708 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Pioupiou 🐤
================================================================================[](https://github.com/boisgera/pioupiou/actions/workflows/build.yml)
[](https://boisgera.github.io/pioupiou/htmlcov)
[](https://boisgera.github.io/pioupiou)
[](LICENSE.txt)
Introduction
--------------------------------------------------------------------------------Pioupiou is a nano probabilistic programming language, embedded into Python.
Use it to define probabilistic models :
>>> import pioupiou as pp
>>> a, b = 0.5, 1.0
>>> X = pp.Uniform(0.0, 1.0)
>>> E = pp.Normal(0.0, 0.01)
>>> Y = a * X + b + Eand to simulate them :
>>> n = 1000 # number of samples
>>> omega = pp.Omega(n)
>>> x, y = X(omega), Y(omega)
>>> x # doctest: +ELLIPSIS
array([6.36961687e-01, 2.69786714e-01, 4.09735239e-02, ..., 3.80007897e-01])
>>> y # doctest: +ELLIPSIS
array([1.09588258, 1.22942954, 1.01954509, 0.99213115, ..., 1.14366864])That's about it! Use this data as you see fit.

Getting started
--------------------------------------------------------------------------------Install the latest version of pioupiou with
$ pip install --upgrade git+https://github.com/boisgera/pioupiou.git
then have a look at the documentation : 🐤.