bayinx 0.2.30__tar.gz → 0.2.32__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.
Files changed (34) hide show
  1. {bayinx-0.2.30 → bayinx-0.2.32}/PKG-INFO +1 -1
  2. {bayinx-0.2.30 → bayinx-0.2.32}/pyproject.toml +2 -2
  3. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/constraints/lower.py +5 -5
  4. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/core/constraint.py +2 -2
  5. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/flows/fullaffine.py +1 -1
  6. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/normalizing_flow.py +1 -1
  7. {bayinx-0.2.30 → bayinx-0.2.32}/.github/workflows/release_and_publish.yml +0 -0
  8. {bayinx-0.2.30 → bayinx-0.2.32}/.gitignore +0 -0
  9. {bayinx-0.2.30 → bayinx-0.2.32}/README.md +0 -0
  10. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/__init__.py +0 -0
  11. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/constraints/__init__.py +0 -0
  12. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/core/__init__.py +0 -0
  13. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/core/flow.py +0 -0
  14. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/core/model.py +0 -0
  15. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/core/variational.py +0 -0
  16. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/__init__.py +0 -0
  17. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/bernoulli.py +0 -0
  18. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/censored/__init__.py +0 -0
  19. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/censored/gamma2/r.py +0 -0
  20. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/gamma2.py +0 -0
  21. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/normal.py +0 -0
  22. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/dists/uniform.py +0 -0
  23. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/__init__.py +0 -0
  24. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/__init__.py +0 -0
  25. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/flows/__init__.py +0 -0
  26. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/flows/planar.py +0 -0
  27. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/flows/radial.py +0 -0
  28. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/flows/sylvester.py +0 -0
  29. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/meanfield.py +0 -0
  30. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/mhx/vi/standard.py +0 -0
  31. {bayinx-0.2.30 → bayinx-0.2.32}/src/bayinx/py.typed +0 -0
  32. {bayinx-0.2.30 → bayinx-0.2.32}/tests/__init__.py +0 -0
  33. {bayinx-0.2.30 → bayinx-0.2.32}/tests/test_variational.py +0 -0
  34. {bayinx-0.2.30 → bayinx-0.2.32}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bayinx
3
- Version: 0.2.30
3
+ Version: 0.2.32
4
4
  Summary: Bayesian Inference with JAX
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: equinox>=0.11.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "bayinx"
3
- version = "0.2.30"
3
+ version = "0.2.32"
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.2.30"
22
+ current_version = "0.2.32"
23
23
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
24
24
  serialize = ["{major}.{minor}.{patch}"]
25
25
  search = "{current_version}"
@@ -6,7 +6,7 @@ from jaxtyping import Array, ArrayLike, Scalar, ScalarLike
6
6
  from bayinx.core.constraint import Constraint
7
7
 
8
8
 
9
- class LowerBound(Constraint):
9
+ class Lower(Constraint):
10
10
  """
11
11
  Enforces a lower bound on the parameter.
12
12
  """
@@ -18,7 +18,7 @@ class LowerBound(Constraint):
18
18
 
19
19
  def constrain(self, x: ArrayLike) -> Tuple[Array, Scalar]:
20
20
  """
21
- Applies the lower bound constraint and computes the laj.
21
+ Applies the lower bound constraint and adjusts the posterior density.
22
22
 
23
23
  # Parameters
24
24
  - `x`: The unconstrained JAX Array-like input.
@@ -26,12 +26,12 @@ class LowerBound(Constraint):
26
26
  # Parameters
27
27
  A tuple containing:
28
28
  - The constrained JAX Array (x > self.lb).
29
- - A scalar JAX Array representing the laj of the transformation.
29
+ - A scalar JAX Array representing the log-absolute-Jacobian of the transformation.
30
30
  """
31
31
  # Compute transformation adjustment
32
- ladj: Scalar = jnp.sum(x)
32
+ laj: Scalar = jnp.sum(x)
33
33
 
34
34
  # Compute transformation
35
35
  x = jnp.exp(x) + self.lb
36
36
 
37
- return x, ladj
37
+ return x, laj
@@ -13,7 +13,7 @@ class Constraint(eqx.Module):
13
13
  @abstractmethod
14
14
  def constrain(self, x: ArrayLike) -> Tuple[Array, Scalar]:
15
15
  """
16
- Applies the constraining transformation to an unconstrained input and computes the log-absolute-jacobian of the transformation.
16
+ Applies the constraining transformation to an unconstrained input and computes the log-absolute-Jacobian of the transformation.
17
17
 
18
18
  # Parameters
19
19
  - `x`: The unconstrained JAX Array-like input.
@@ -21,6 +21,6 @@ class Constraint(eqx.Module):
21
21
  # Returns
22
22
  A tuple containing:
23
23
  - The constrained JAX Array.
24
- - A scalar JAX Array representing the laj of the transformation.
24
+ - A scalar JAX Array representing the log-absolute-Jacobian of the transformation.
25
25
  """
26
26
  pass
@@ -40,7 +40,7 @@ class FullAffine(Flow):
40
40
  diag: Array = jnp.exp(jnp.diag(scale))
41
41
 
42
42
  # Return matrix with modified diagonal
43
- return jnp.fill_diagonal(scale, diag, inplace=False)
43
+ return jnp.fill_diagonal(jnp.tril(scale), diag, inplace=False)
44
44
 
45
45
  self.constraints = {"scale": constrain_scale}
46
46
 
@@ -75,7 +75,7 @@ class NormalizingFlow(Variational):
75
75
 
76
76
  for map in self.flows:
77
77
  # Compute adjustment
78
- laj, draws = map.adjust_density(draws)
78
+ draws, laj = map.adjust_density(draws)
79
79
 
80
80
  # Adjust variational density
81
81
  variational_evals = variational_evals - laj
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes