bayinx 0.3.13__py3-none-any.whl → 0.3.14__py3-none-any.whl

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.
@@ -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: 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
- ) -> Model:
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: Model):
38
+ def eval_grad(dyn: M):
39
39
  # Reconstruct model
40
- model: Model = eqx.combine(dyn, static)
40
+ model: M = eqx.combine(dyn, static)
41
41
 
42
42
  # Evaluate posterior
43
43
  return model.eval(data)
bayinx/core/_parameter.py CHANGED
@@ -5,8 +5,6 @@ import jax.tree as jt
5
5
  from jaxtyping import PyTree
6
6
 
7
7
  T = TypeVar("T", bound=PyTree)
8
-
9
-
10
8
  class Parameter(eqx.Module, Generic[T]):
11
9
  """
12
10
  A container for a parameter of a `Model`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bayinx
3
- Version: 0.3.13
3
+ Version: 0.3.14
4
4
  Summary: Bayesian Inference with JAX
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -6,8 +6,8 @@ bayinx/core/__init__.py,sha256=Qmy0EjzqqKwI9F8rjmC9j6J8hiDw6A54yOck2WuQJkY,344
6
6
  bayinx/core/_constraint.py,sha256=Gx07ZT66VE2y-qZCmBDm3_y0wO4xQyslZW10Lec1_lM,761
7
7
  bayinx/core/_flow.py,sha256=3q4rKvATnbUpuj4ICUd4lIxu_3z7GRDuNujVhAku1X0,2342
8
8
  bayinx/core/_model.py,sha256=FJUyYVE9e2uTFamxtSMKY_VV2stiU2QF68Wl_7EAKEU,2895
9
- bayinx/core/_optimization.py,sha256=cXO07guDG5kd64kWq4_de-gLgxTT6vIOU3IOL3TMl6U,2583
10
- bayinx/core/_parameter.py,sha256=UfLonbTwxzr1g76Cf3HzAh9u4UBtlcaLByYLXgq-aCQ,1082
9
+ bayinx/core/_optimization.py,sha256=dL3COMFTP0_FeD44hreNybh_UD6zqJy6sSP54ITJsBc,2605
10
+ bayinx/core/_parameter.py,sha256=r20JedTW2lY0miNNh9y6LeIVAsGX1kP_rlGxphW_jZg,1080
11
11
  bayinx/core/_variational.py,sha256=bQYiN8c4AGPt4hsNT68zN7J6o0fdsLGwVjbDyl62LnI,5639
12
12
  bayinx/dists/__init__.py,sha256=BIrypqMnTLWK3a_zw8fYKMyuEMxP_qGsLfLeScias0o,118
13
13
  bayinx/dists/bernoulli.py,sha256=xMV9BgtVX_1XkPdZ43q0meMIEkgMyuUPx--dyo6_DKs,1006
@@ -31,7 +31,7 @@ bayinx/mhx/vi/flows/fullaffine.py,sha256=11y_A0oO3bkKDSz-EQ6Sf4Ec2M7vHZxw94EdvAD
31
31
  bayinx/mhx/vi/flows/planar.py,sha256=2I2WzIskl8MRpJkK13FQE3vSF-077qo8gRed_EL1Pn8,1920
32
32
  bayinx/mhx/vi/flows/radial.py,sha256=e0GfuO-CL8SVr3YnEfsxStpyKcJlFpzMyjMp3sa38hg,2503
33
33
  bayinx/mhx/vi/flows/sylvester.py,sha256=ppK0BmS_ThvrCEhJiP_-p-kj67TQHSlU_RUZpDbIhsQ,469
34
- bayinx-0.3.13.dist-info/METADATA,sha256=1mcHMTXrzMGPcibMy_vHdBJMNPtT0VUF83eVBS_MJlg,3080
35
- bayinx-0.3.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
- bayinx-0.3.13.dist-info/licenses/LICENSE,sha256=VMhLhj5hx6VAENZBaNfXrmsNl7ov9uRh0jZ6D3ltgv4,1070
37
- bayinx-0.3.13.dist-info/RECORD,,
34
+ bayinx-0.3.14.dist-info/METADATA,sha256=ba_0a1aYSrKIGhGFG_IWA7TltEmGpK78IqCFeLV7XVI,3080
35
+ bayinx-0.3.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
+ bayinx-0.3.14.dist-info/licenses/LICENSE,sha256=VMhLhj5hx6VAENZBaNfXrmsNl7ov9uRh0jZ6D3ltgv4,1070
37
+ bayinx-0.3.14.dist-info/RECORD,,