Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A simple probabilistic programming language.
| Date | Stars |
|---|---|
| 2026-07-24 | 711 |
| 2026-07-25 | 711 |
| 2026-07-28 | 711 |
| 2026-07-30 | 711 |
| 2026-08-06 | 711 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Edward2
Edward2 is a _simple_ probabilistic programming language. It provides core
utilities in deep learning ecosystems so that one can write models as
probabilistic programs and manipulate a model's computation for flexible
training and inference. It's organized as follows:
* [`edward2/`](https://github.com/google/edward2/blob/main/edward2/):
Library code.
* [`examples/`](https://github.com/google/edward2/blob/main/examples):
Examples.
* [`experimental/`](https://github.com/google/edward2/blob/main/experimental):
Active research projects.
Are you upgrading from Edward? Check out the guide
[`Upgrading_from_Edward_to_Edward2.md`](https://github.com/google/edward2/blob/main/Upgrading_From_Edward_To_Edward2.md).
The core utilities are fairly low-level: if you'd like a high-level module for
uncertainty modeling, check out the guide for
[Bayesian Layers](https://github.com/google/edward2/tree/main/edward2/tensorflow/layers).
We recommend the
[Uncertainty Baselines](https://github.com/google/uncertainty-baselines)
if you'd like to build on research-ready code.
## Installation
We recommend the latest development version. To install, run
```sh
pip install "edward2 @ git+https://github.com/google/edward2.git"
```
You can also install the latest stable version using the following. As a caveat,
however, we very rarely update the stable version (this is a passion project
maintained by part-timers and scheduling releases every so often sucks up time).
```sh
pip install edward2
```
Edward2 supports three backends: TensorFlow (the default), JAX, and NumPy ([see
below to activate](#using-the-jax-or-numpy-backend)). Installing `edward2` does
not automatically install any backend. To get these dependencies, use for
example `pip install edward2[tensorflow]"`, replacing `tensorflow` for the
appropriate backend. Sometimes Edward2 uses the latest changes from TensorFlow
in which you'll need TensorFlow's nightly package: use `pip install edward2[tf-
nightly]`.
## 1. Models as Probabilistic Programs
### Random Variables
In Edward2, we use
[`RandomVariables`](https://github.com/google/edward2/blob/main/edward2/tensorflow/random_variable.py)
to specify a probabilistic model's structure.
A random variable `rv` carries a probability distribution (`rv.distribution`),
which is a TensorFlow Distribution instance governing the random variable's methods
such as `log_prob` and `sample`.
Random variables are formed like TensorFlow Distributions.
```python
import edward2 as ed
normal_rv = ed.Normal(loc=0., scale=1.)
## <ed.RandomVariable 'Normal/' shape=() dtype=float32 numpy=0.0024812892>
normal_rv.distribution.log_prob(1.231)
## <tf.Tensor: id=11, shape=(), dtype=float32, numpy=-1.6766189>
dirichlet_rv = ed.Dirichlet(concentration=tf.ones([2, 3]))
## <ed.RandomVariable 'Dirichlet/' shape=(2, 3) dtype=float32 numpy=
array([[0.15864784, 0.01217205, 0.82918006],
[0.23385087, 0.69622266, 0.06992647]], dtype=float32)>
```
By default, instantiating a random variable `rv` creates a sampling op to form
the tensor `rv.value ~ rv.distribution.sample()`. The default number of samples
(controllable via the `sample_shape` argument to `rv`) is one, and if the
optional `value` argument is provided, no sampling op is created. Random
variables can interoperate with TensorFlow ops: the TF ops operate on the sample.
```python
x = ed.Normal(loc=tf.zeros(2), scale=tf.ones(2))
y = 5.
x + y, x / y
## (<tf.Tensor: id=109, shape=(2,), dtype=float32, numpy=array([3.9076924, 4.588356 ], dtype=float32)>,
## <tf.Tensor: id=111, shape=(2,), dtype=float32, numpy=array([-0.21846154, -0.08232877], dtype=float32)>)
tf.tanh(x * y)
## <tf.Tensor: id=114, shape=(2,), dtype=float32, numpy=array([-0.99996394, -0.9679181 ], dtype=float32)>
x[1] # 2nd normal rv
## <ed.RandomVariable 'Normal/' shape=() dtype=float32 numpy=-0.41164386>
```
### Probabilistic Models
Probabilistic models in Edward2 are expressed as Python functions that
instantiate one or more `RandomExcerpt of 12,086 characters
Read on GitHub48
34
28
25
17
Dustin Tran · Google DeepMind · United States
13
8
Yilei · United States
6
Zachary Nado
5
Peter Hawkins · Google
4
4
Du Phan · Google
3
3
Rebecca Chen
3
3
Qianli Scott Zhu · Google · United States
2
Marcus Chiam · Google DeepMind · United Kingdom
2
Shreyas Padhy · Isomorphic Labs · United Kingdom
2
François Chollet
2
Smit Hinsu
2
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:364f0ccfa8503c91, topic:deep-learning, topic:tensorflow