Skip to content

Commit

Permalink
Merge pull request #44 from blab/fix-jax-array-type
Browse files Browse the repository at this point in the history
Replace `KeyArray` with `jax.Array`
  • Loading branch information
marlinfiggins authored Dec 17, 2024
2 parents 2c91dd8 + 7341ab4 commit 0736267
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions evofr/infer/MCMC_handler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import pickle
from typing import Callable, Dict, Optional, Type

from jax import random
from jax._src.random import KeyArray
from jax import random, Array
from numpyro.infer import MCMC, NUTS, Predictive
from numpyro.infer.mcmc import MCMCKernel


class MCMCHandler:
def __init__(
self,
rng_key: Optional[KeyArray] = None,
rng_key: Optional[Array] = None,
kernel: Optional[Type[MCMCKernel]] = None,
**kernel_kwargs
):
Expand Down
5 changes: 2 additions & 3 deletions evofr/infer/SVI_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from typing import Any, Callable, Optional

import jax.example_libraries.optimizers as optimizers
from jax import random
from jax._src.random import KeyArray
from jax import random, Array
from numpyro.infer import SVI, Predictive, Trace_ELBO
from numpyro.infer.autoguide import AutoGuide
from numpyro.infer.svi import SVIState
Expand All @@ -14,7 +13,7 @@
class SVIHandler:
def __init__(
self,
rng_key: Optional[KeyArray] = None,
rng_key: Optional[Array] = None,
loss: Optional[Trace_ELBO] = None,
optimizer: Optional[Optimizer] = None,
):
Expand Down

0 comments on commit 0736267

Please sign in to comment.