Last active
November 7, 2021 09:08
-
-
Save MarcoGorelli/ba8d9151b41cc5cf0bc22d97ab5e25f8 to your computer and use it in GitHub Desktop.
boilerplate for pushforwards distributions example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import jax | |
import jax.numpy as jnp | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import numpyro.distributions as dist | |
import pandas as pd | |
import seaborn as sns | |
from matplotlib import patches | |
sns.set() | |
mu = jnp.zeros(2) | |
cov = jnp.array([[0.5, 0.2], [0.2, 0.1]]) | |
distribution = dist.MultivariateNormal(mu, cov) | |
rng_key = jax.random.PRNGKey(2) | |
def g(x): | |
return jnp.asarray([jax.scipy.special.expit(x[0]), jnp.exp(x[1])]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment