Skip to content

Instantly share code, notes, and snippets.

@MarcoGorelli
Last active November 7, 2021 09:08
Show Gist options
  • Save MarcoGorelli/ba8d9151b41cc5cf0bc22d97ab5e25f8 to your computer and use it in GitHub Desktop.
Save MarcoGorelli/ba8d9151b41cc5cf0bc22d97ab5e25f8 to your computer and use it in GitHub Desktop.
boilerplate for pushforwards distributions example
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