bayinx 0.2.13__py3-none-any.whl → 0.2.19__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.
bayinx/dists/normal.py CHANGED
@@ -19,7 +19,7 @@ def prob(
19
19
  The PDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `mu`, and `sigma`.
20
20
  """
21
21
 
22
- return _lax.exp(-0.5 * _lax.square((x - mu) / sigma)) / (
22
+ return _lax.exp(-0.5 * _lax.square((x - mu) / sigma)) / ( # pyright: ignore
23
23
  sigma * _lax.sqrt(2.0 * _PI)
24
24
  )
25
25
 
@@ -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)
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(
@@ -57,7 +57,7 @@ def uprob(
57
57
  The uPDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `mu`, and `sigma`.
58
58
  """
59
59
 
60
- return _lax.exp(-0.5 * _lax.square((x - mu) / sigma)) / sigma
60
+ return _lax.exp(-0.5 * _lax.square((x - mu) / sigma)) / sigma # pyright: ignore
61
61
 
62
62
 
63
63
  def ulogprob(
@@ -75,4 +75,4 @@ def ulogprob(
75
75
  The log uPDF evaluated at `x`. The output will have the broadcasted shapes of `x`, `mu`, and `sigma`.
76
76
  """
77
77
 
78
- return -_lax.log(sigma) - 0.5 * _lax.square((x - mu) / sigma)
78
+ return -_lax.log(sigma) - 0.5 * _lax.square((x - mu) / sigma) # pyright: ignore
@@ -1,8 +1,6 @@
1
- from functools import partial
2
1
  from typing import Any, Callable, Self, Tuple
3
2
 
4
3
  import equinox as eqx
5
- import jax
6
4
  import jax.flatten_util as jfu
7
5
  import jax.numpy as jnp
8
6
  import jax.random as jr
@@ -61,7 +59,6 @@ class NormalizingFlow(Variational):
61
59
  return draws
62
60
 
63
61
  @eqx.filter_jit
64
- @partial(jax.vmap, in_axes=(None, 0))
65
62
  def eval(self, draws: Array) -> Array:
66
63
  # Evaluate base density
67
64
  variational_evals: Array = self.base.eval(draws)
bayinx/mhx/vi/standard.py CHANGED
@@ -52,7 +52,7 @@ class Standard(Variational):
52
52
  x=draws,
53
53
  mu=jnp.array(0.0),
54
54
  sigma=jnp.array(1.0),
55
- ).sum(axis=1)
55
+ ).sum(axis=1, keepdims=True)
56
56
 
57
57
  @eqx.filter_jit
58
58
  def filter_spec(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bayinx
3
- Version: 0.2.13
3
+ Version: 0.2.19
4
4
  Summary: Bayesian Inference with JAX
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: equinox>=0.11.12
@@ -10,17 +10,17 @@ bayinx/dists/bernoulli.py,sha256=xMV9BgtVX_1XkPdZ43q0meMIEkgMyuUPx--dyo6_DKs,100
10
10
  bayinx/dists/binomial.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  bayinx/dists/gamma.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  bayinx/dists/gamma2.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- bayinx/dists/normal.py,sha256=OOKg46y5hHFP76ydbRjEXaDkgefZcj9sd0XAl7yokww,2587
13
+ bayinx/dists/normal.py,sha256=cfstoFSXeX3RS9AUyjKyjRR4G2Mi36o2FhyT1cfRTNw,2659
14
14
  bayinx/mhx/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
15
15
  bayinx/mhx/vi/__init__.py,sha256=YfkXKsqo9Dk_AmQGjZKm4vfG8eLer2ez92G-cOExphs,193
16
16
  bayinx/mhx/vi/meanfield.py,sha256=LNLwfjKO9os7YBmRBpGEiFxlxonuN7DHVFEmXV3hvfI,3876
17
- bayinx/mhx/vi/normalizing_flow.py,sha256=O9U40Z7ANAh4Weqs7jaNHqmG5UkdlNooUP8Vx1u7hwg,4873
18
- bayinx/mhx/vi/standard.py,sha256=m5gtcHfrYzV28h-Red3Zn6SxEgJlndeIXiIG5gDPecU,1703
17
+ bayinx/mhx/vi/normalizing_flow.py,sha256=XBUWYZpm_Ipi6X9oTnGhqIs3ARY-5QFiuxM7uAWFRps,4790
18
+ bayinx/mhx/vi/standard.py,sha256=HaJsIz70Qo1Ql2hMQ-GQhcnfWiOGtyxgkOsm_yQaDKI,1718
19
19
  bayinx/mhx/vi/flows/__init__.py,sha256=Hn0Wqvvyv8Vr-mFmimwgNKCByxj-fjrlIvdR7tUSolg,180
20
20
  bayinx/mhx/vi/flows/fullaffine.py,sha256=2QbOtA1Jmu-yRcJeFmCKc8N1atm8G7JXYMLEZaEXKV0,1711
21
21
  bayinx/mhx/vi/flows/planar.py,sha256=qmtWpIBXRct2seI78pkmtF0X7cASUBELqmZmf2QS5Gs,1918
22
22
  bayinx/mhx/vi/flows/radial.py,sha256=c-SWybGn_jmgBQk9ZMQ5uHKPzcdhowNp8MD8t1-8VZM,2501
23
23
  bayinx/mhx/vi/flows/sylvester.py,sha256=ppK0BmS_ThvrCEhJiP_-p-kj67TQHSlU_RUZpDbIhsQ,469
24
- bayinx-0.2.13.dist-info/METADATA,sha256=3Do4je5M1N3-DKmo0tG1a0ULG91ECcCQe-B60E-EuPA,3058
25
- bayinx-0.2.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- bayinx-0.2.13.dist-info/RECORD,,
24
+ bayinx-0.2.19.dist-info/METADATA,sha256=csd2SrZaiXXi66uQGVDu7Vd69riaIWmFhlPFEscX8Eo,3058
25
+ bayinx-0.2.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ bayinx-0.2.19.dist-info/RECORD,,