bayinx 0.2.21__tar.gz → 0.2.22__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 (32) hide show
  1. {bayinx-0.2.21 → bayinx-0.2.22}/PKG-INFO +1 -1
  2. {bayinx-0.2.21 → bayinx-0.2.22}/pyproject.toml +2 -2
  3. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/dists/normal.py +3 -3
  4. bayinx-0.2.22/src/bayinx/dists/uniform.py +75 -0
  5. {bayinx-0.2.21 → bayinx-0.2.22}/.github/workflows/release_and_publish.yml +0 -0
  6. {bayinx-0.2.21 → bayinx-0.2.22}/.gitignore +0 -0
  7. {bayinx-0.2.21 → bayinx-0.2.22}/README.md +0 -0
  8. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/__init__.py +0 -0
  9. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/core/__init__.py +0 -0
  10. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/core/flow.py +0 -0
  11. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/core/model.py +0 -0
  12. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/core/utils.py +0 -0
  13. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/core/variational.py +0 -0
  14. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/dists/__init__.py +0 -0
  15. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/dists/bernoulli.py +0 -0
  16. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/dists/binomial.py +0 -0
  17. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/dists/gamma.py +0 -0
  18. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/dists/gamma2.py +0 -0
  19. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/__init__.py +0 -0
  20. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/__init__.py +0 -0
  21. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/flows/__init__.py +0 -0
  22. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/flows/fullaffine.py +0 -0
  23. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/flows/planar.py +0 -0
  24. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/flows/radial.py +0 -0
  25. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/flows/sylvester.py +0 -0
  26. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/meanfield.py +0 -0
  27. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/normalizing_flow.py +0 -0
  28. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/mhx/vi/standard.py +0 -0
  29. {bayinx-0.2.21 → bayinx-0.2.22}/src/bayinx/py.typed +0 -0
  30. {bayinx-0.2.21 → bayinx-0.2.22}/tests/__init__.py +0 -0
  31. {bayinx-0.2.21 → bayinx-0.2.22}/tests/test_variational.py +0 -0
  32. {bayinx-0.2.21 → bayinx-0.2.22}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bayinx
3
- Version: 0.2.21
3
+ Version: 0.2.22
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.21"
3
+ version = "0.2.22"
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.21"
22
+ current_version = "0.2.22"
23
23
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
24
24
  serialize = ["{major}.{minor}.{patch}"]
25
25
  search = "{current_version}"
@@ -1,7 +1,7 @@
1
1
  import jax.lax as _lax
2
2
  from jaxtyping import Array, ArrayLike, Float, Real
3
3
 
4
- _PI = 3.141592653589793
4
+ __PI = 3.141592653589793
5
5
 
6
6
 
7
7
  def prob(
@@ -20,7 +20,7 @@ def prob(
20
20
  """
21
21
 
22
22
  return _lax.exp(-0.5 * _lax.square((x - mu) / sigma)) / ( # pyright: ignore
23
- sigma * _lax.sqrt(2.0 * _PI)
23
+ sigma * _lax.sqrt(2.0 * __PI)
24
24
  )
25
25
 
26
26
 
@@ -39,7 +39,7 @@ def logprob(
39
39
  The log of the PDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `mu`, and `sigma`.
40
40
  """
41
41
 
42
- return -_lax.log(sigma * _lax.sqrt(2.0 * _PI)) - 0.5 * _lax.square((x - mu) / sigma) # pyright: ignore
42
+ return -_lax.log(sigma * _lax.sqrt(2.0 * __PI)) - 0.5 * _lax.square((x - mu) / sigma) # pyright: ignore
43
43
 
44
44
 
45
45
  def uprob(
@@ -0,0 +1,75 @@
1
+ import jax.lax as _lax
2
+ import jax.numpy as jnp
3
+ from jaxtyping import Array, ArrayLike, Float, Real
4
+
5
+
6
+ def prob(
7
+ x: Real[ArrayLike, "..."], lb: Real[ArrayLike, "..."], ub: Real[ArrayLike, "..."]
8
+ ) -> Float[Array, "..."]:
9
+ """
10
+ The probability density function (PDF) for a Uniform distribution.
11
+
12
+ # Parameters
13
+ - `x`: Value(s) at which to evaluate the PDF.
14
+ - `lb`: The lower bound parameter(s).
15
+ - `ub`: The upper bound parameter(s).
16
+
17
+ # Returns
18
+ The PDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `lb`, and `ub`.
19
+ """
20
+
21
+ return 1.0 / (ub - lb) # pyright: ignore
22
+
23
+
24
+ def logprob(
25
+ x: Real[ArrayLike, "..."], lb: Real[ArrayLike, "..."], ub: Real[ArrayLike, "..."]
26
+ ) -> Float[Array, "..."]:
27
+ """
28
+ The log of the probability density function (log PDF) for a Uniform distribution.
29
+
30
+ # Parameters
31
+ - `x`: Value(s) at which to evaluate the PDF.
32
+ - `lb`: The lower bound parameter(s).
33
+ - `ub`: The upper bound parameter(s).
34
+
35
+ # Returns
36
+ The log of the PDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `lb`, and `ub`.
37
+ """
38
+
39
+ return _lax.log(1.0) - _lax.log(ub - lb) # pyright: ignore
40
+
41
+
42
+ def uprob(
43
+ x: Real[ArrayLike, "..."], lb: Real[ArrayLike, "..."], ub: Real[ArrayLike, "..."]
44
+ ) -> Float[Array, "..."]:
45
+ """
46
+ The unnormalized probability density function (uPDF) for a Uniform distribution.
47
+
48
+ # Parameters
49
+ - `x`: Value(s) at which to evaluate the PDF.
50
+ - `lb`: The lower bound parameter(s).
51
+ - `ub`: The upper bound parameter(s).
52
+
53
+ # Returns
54
+ The uPDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `lb`, and `ub`.
55
+ """
56
+
57
+ return jnp.ones(jnp.broadcast_arrays(x,lb,ub))
58
+
59
+
60
+ def ulogprob(
61
+ x: Real[ArrayLike, "..."], lb: Real[ArrayLike, "..."], ub: Real[ArrayLike, "..."]
62
+ ) -> Float[Array, "..."]:
63
+ """
64
+ The log of the unnormalized probability density function (log uPDF) for a Uniform distribution.
65
+
66
+ # Parameters
67
+ - `x`: Value(s) at which to evaluate the PDF.
68
+ - `lb`: The lower bound parameter(s).
69
+ - `ub`: The upper bound parameter(s).
70
+
71
+ # Returns
72
+ The log uPDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `lb`, and `ub`.
73
+ """
74
+
75
+ return jnp.zeros(jnp.broadcast_arrays(x,lb,ub))
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes