Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace KeyArray with jax.Array #44

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading