This file contains 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 jax | |
import jax.random as random | |
from numpyro.infer import SVI | |
def batch_svi_setup(model, guide, optim, loss, | |
model_args, | |
*, | |
rng_key, | |
svi_init_params=None, | |
n_init=1, |
This file contains 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
from functools import partial | |
from operator import attrgetter | |
import jax | |
import jax.numpy as jnp | |
import jax.random as random | |
@partial(jax.jit, static_argnames=['field_names']) | |
def collect_fields(state, field_names: tuple): | |
""" |