bayinx 0.2.11__py3-none-any.whl → 0.2.12__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.
@@ -3,7 +3,6 @@ from typing import Callable, Dict, Tuple
3
3
 
4
4
  import equinox as eqx
5
5
  import jax
6
- import jax.nn as jnn
7
6
  import jax.numpy as jnp
8
7
  import jax.random as jr
9
8
  from jaxtyping import Array, Float, Scalar
@@ -31,25 +30,12 @@ class Planar(Flow):
31
30
  - `dim`: The dimension of the parameter space.
32
31
  """
33
32
  self.params = {
34
- "u": jr.normal(key, (dim,)),
35
- "w": jr.normal(key, (dim,)),
36
- "b": jr.normal(key, (1,)),
33
+ "u": jnp.ones(dim),
34
+ "w": jnp.ones(dim),
35
+ "b": jnp.zeros(1),
37
36
  }
38
37
  self.constraints = {}
39
38
 
40
- def transform_pars(self):
41
- params = self.params
42
-
43
- u = params['u']
44
- w = params['w']
45
- b = params['b']
46
-
47
- m = jnn.softplus(w.dot(u)) - 1.0
48
-
49
- u = u + (m - w.dot(u)) * w / (w**2).sum()
50
-
51
- return {'u': u, 'w': w, 'b': b}
52
-
53
39
  @eqx.filter_jit
54
40
  @partial(jax.vmap, in_axes=(None, 0))
55
41
  def forward(self, draws: Array) -> Array:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bayinx
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: Bayesian Inference with JAX
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: equinox>=0.11.12
@@ -18,9 +18,9 @@ bayinx/mhx/vi/normalizing_flow.py,sha256=XBUWYZpm_Ipi6X9oTnGhqIs3ARY-5QFiuxM7uAW
18
18
  bayinx/mhx/vi/standard.py,sha256=m5gtcHfrYzV28h-Red3Zn6SxEgJlndeIXiIG5gDPecU,1703
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
- bayinx/mhx/vi/flows/planar.py,sha256=u4heNqxpmfXsACsE3RH8XkBd04Emd8G674M3sSd7CxM,2232
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.11.dist-info/METADATA,sha256=TkIGXb5baSFeP5K4s1bynQ3QqNsR-DKePlAOV_vV0Nc,3058
25
- bayinx-0.2.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- bayinx-0.2.11.dist-info/RECORD,,
24
+ bayinx-0.2.12.dist-info/METADATA,sha256=q4e6XXwZ6ejyBWsyk_wXGDqJG9YCBK1gew93Pg_PncU,3058
25
+ bayinx-0.2.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ bayinx-0.2.12.dist-info/RECORD,,