bayinx 0.3.13__tar.gz → 0.3.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bayinx-0.3.13 → bayinx-0.3.14}/PKG-INFO +1 -1
- {bayinx-0.3.13 → bayinx-0.3.14}/pyproject.toml +2 -2
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/_optimization.py +6 -6
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/_parameter.py +0 -2
- {bayinx-0.3.13 → bayinx-0.3.14}/.github/workflows/release_and_publish.yml +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/.gitignore +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/LICENSE +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/README.md +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/constraints/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/constraints/lower.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/_constraint.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/_flow.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/_model.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/core/_variational.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/bernoulli.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/censored/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/censored/gamma2/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/censored/gamma2/r.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/censored/posnormal/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/censored/posnormal/r.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/gamma2.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/normal.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/posnormal.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/dists/uniform.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/opt/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/flows/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/flows/fullaffine.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/flows/planar.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/flows/radial.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/flows/sylvester.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/meanfield.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/normalizing_flow.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/mhx/vi/standard.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/src/bayinx/py.typed +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/tests/__init__.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/tests/test_predictive.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/tests/test_variational.py +0 -0
- {bayinx-0.3.13 → bayinx-0.3.14}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "bayinx"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.14"
|
4
4
|
description = "Bayesian Inference with JAX"
|
5
5
|
readme = "README.md"
|
6
6
|
requires-python = ">=3.12"
|
@@ -19,7 +19,7 @@ build-backend = "hatchling.build"
|
|
19
19
|
addopts = "-q --benchmark-min-rounds=30 --benchmark-columns=rounds,mean,median,stddev --benchmark-group-by=func"
|
20
20
|
|
21
21
|
[tool.bumpversion]
|
22
|
-
current_version = "0.3.
|
22
|
+
current_version = "0.3.14"
|
23
23
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
24
24
|
serialize = ["{major}.{minor}.{patch}"]
|
25
25
|
search = "{current_version}"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any, Tuple
|
1
|
+
from typing import Any, Tuple, TypeVar
|
2
2
|
|
3
3
|
import equinox as eqx
|
4
4
|
import jax.lax as lax
|
@@ -9,16 +9,16 @@ from optax import GradientTransformation, OptState, Schedule
|
|
9
9
|
|
10
10
|
from ._model import Model
|
11
11
|
|
12
|
-
|
12
|
+
M = TypeVar("M", bound=Model)
|
13
13
|
@eqx.filter_jit
|
14
14
|
def optimize_model(
|
15
|
-
model:
|
15
|
+
model: M,
|
16
16
|
max_iters: int,
|
17
17
|
data: Any = None,
|
18
18
|
learning_rate: float = 1,
|
19
19
|
weight_decay: float = 0.0,
|
20
20
|
tolerance: float = 1e-4,
|
21
|
-
) ->
|
21
|
+
) -> M:
|
22
22
|
"""
|
23
23
|
Optimize the dynamic parameters of the model.
|
24
24
|
|
@@ -35,9 +35,9 @@ def optimize_model(
|
|
35
35
|
# Derive gradient for posterior
|
36
36
|
@eqx.filter_jit
|
37
37
|
@eqx.filter_grad
|
38
|
-
def eval_grad(dyn:
|
38
|
+
def eval_grad(dyn: M):
|
39
39
|
# Reconstruct model
|
40
|
-
model:
|
40
|
+
model: M = eqx.combine(dyn, static)
|
41
41
|
|
42
42
|
# Evaluate posterior
|
43
43
|
return model.eval(data)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|