probability-flow 1.4.4__tar.gz → 1.5.0__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 (29) hide show
  1. {probability_flow-1.4.4 → probability_flow-1.5.0}/CHANGELOG.md +105 -0
  2. {probability_flow-1.4.4 → probability_flow-1.5.0}/PKG-INFO +1 -1
  3. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/__init__.py +1 -1
  4. probability_flow-1.5.0/probability_flow/generation.py +1637 -0
  5. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/serialize.py +54 -7
  6. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/variable.py +42 -0
  7. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/viz.py +113 -2
  8. {probability_flow-1.4.4 → probability_flow-1.5.0}/pyproject.toml +1 -1
  9. probability_flow-1.4.4/probability_flow/generation.py +0 -906
  10. {probability_flow-1.4.4 → probability_flow-1.5.0}/.gitignore +0 -0
  11. {probability_flow-1.4.4 → probability_flow-1.5.0}/LICENSE +0 -0
  12. {probability_flow-1.4.4 → probability_flow-1.5.0}/README.md +0 -0
  13. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/cpd.py +0 -0
  14. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/decompose.py +0 -0
  15. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/edges.py +0 -0
  16. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/eliminate.py +0 -0
  17. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/engines.py +0 -0
  18. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/evidence.py +0 -0
  19. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/factors.py +0 -0
  20. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/graph.py +0 -0
  21. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/independent.py +0 -0
  22. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/inference.py +0 -0
  23. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/junction.py +0 -0
  24. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/logical.py +0 -0
  25. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/noisy.py +0 -0
  26. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/ordering.py +0 -0
  27. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/py.typed +0 -0
  28. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/query.py +0 -0
  29. {probability_flow-1.4.4 → probability_flow-1.5.0}/probability_flow/reveal.py +0 -0
@@ -1,5 +1,110 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Changed, and this BREAKS SEED REPRODUCTION
6
+
7
+ - **A gated weight is now drawn SPIKE-AND-SLAB, and the default makes every gate a
8
+ true undercut.** `p_pure` (default **1.0**) is the spike: with that probability
9
+ `weight_when_gated` is exactly 0.0, so the premise stops carrying.
10
+ Otherwise the slab, `w * U(*slab_fraction_range)` with
11
+ `slab_fraction_range` defaulting to `(0.0, 1.0)`, an attenuation by a uniform
12
+ fraction of **the modulated edge's own weight**.
13
+
14
+ - **WHY THIS IS A MINOR BUMP AND NOT A PATCH.** At `p_pure = 1.0` the slab draw is
15
+ not taken, which shifts every subsequent draw in the stream. **A seed no longer
16
+ reproduces the graph it produced under 1.4.x.** The graphs are not wrong and
17
+ nothing silently changes meaning, but any artifact that records a seed under the
18
+ old draw must be regenerated or marked as pre-break. The previous release shipped
19
+ a breaking change in a patch and should not have. This one does not repeat it.
20
+
21
+ - **The slab is RELATIVE to the edge's weight, which is why
22
+ `gate_weight_bits_range` is removed rather than kept.** An absolute range made
23
+ the gated weight independent of the edge it modulated, so one setting was
24
+ near-total defeat of a weak edge and a scratch on a strong one. A gate attenuates
25
+ a specific edge, and "a fraction of whatever this edge was worth" is the claim.
26
+
27
+ - **SIGN REVERSAL IS NO LONGER REACHABLE BY DEFAULT, deliberately and reversibly.**
28
+ A same-sign slab cannot cross zero. Under the retired absolute draw, 27.8% of
29
+ gates reversed the sign of their edge, which was a property of that draw rather
30
+ than a modelling choice. Widening the slab below zero , `slab_fraction_range =
31
+ (-0.5, 1.0)`, makes reversal reachable again with no code change.
32
+
33
+ ### Changed, and this also changes every generated graph
34
+
35
+ - **`GraphSpec.evidence_observed` now defaults to `True` rather than `"world"`.**
36
+ Every virtual-evidence node in a generated graph is observed TRUE, instead of
37
+ being observed according to the world the generator sampled. A reader of a
38
+ generated document therefore starts with every instrument having reported,
39
+ rather than with the subset the sampled world happened to trigger.
40
+
41
+ This is a generation default, not a format change: `observed` was already a
42
+ document field and still is. But it moves the numbers in every graph drawn
43
+ after it, so a set built before and a set built after are not comparable even
44
+ at the same seed.
45
+
46
+ ### The SCHEMA version deliberately stays at 1.4.5
47
+
48
+ - **`serialize.VERSION` is the DOCUMENT FORMAT version and no document field
49
+ changed**, so it does not move. The package version goes to 1.5.0 because the
50
+ generator's DRAW changed. The format did not.
51
+ - I bumped both at first and it **stopped another seat within minutes.** The shared
52
+ editable install means this working tree is what every interpreter on the machine
53
+ imports, the reader's series check then refused all 1.4.x documents, and six of
54
+ six committed benchmark graphs plus every run record stopped loading. Reverted
55
+ after verifying all six load again.
56
+ - **A package version and a schema version answer different questions.** "Did
57
+ behaviour change" and "did the file format change" are not the same question, and
58
+ only the second one may refuse to read a file. A breaking change to a DRAW cannot
59
+ justify refusing to read a document.
60
+
61
+ ### Removed
62
+
63
+ - **`GraphSpec.p_hard_undercut`**, superseded by `p_pure`. It named one case of
64
+ what is now a distribution, and the spike-and-slab form says what the draw is.
65
+ - **`GraphSpec.gate_weight_bits_range`**, superseded by `slab_fraction_range`.
66
+ Passing either now raises.
67
+
68
+ ## 1.4.5
69
+
70
+ ### Removed, and this is a BREAKING CHANGE IN A PATCH RELEASE
71
+
72
+ - **`GraphSpec` no longer accepts `max_attempts` or `gate_size_range`.** Both
73
+ were declared and never read, so passing either did nothing. Passing one now
74
+ raises:
75
+
76
+ GraphSpec(max_attempts=5)
77
+ TypeError: GraphSpec.__init__() got an unexpected keyword argument 'max_attempts'
78
+
79
+ Raising is the better behaviour and the removal is right. **Shipping it in a
80
+ patch was not**, and the fault is in how this release was assembled rather
81
+ than in the change: the version level was chosen by looking at one commit's
82
+ diff instead of the diff between the tags, which is what a release is. Twelve
83
+ commits shipped and the note described one of them.
84
+
85
+ If you are pinned inside 1.4.x and construct a `GraphSpec` with either name,
86
+ delete the argument. It was never doing anything.
87
+
88
+ ### Added
89
+
90
+ - **`evidence_depth_tilt` on `GraphSpec`**, which makes the debate shape
91
+ reachable rather than only the layout.
92
+ - **`variable.gates` and `variable.gate_sources`.** A gate source is a parent,
93
+ so it appears in `parents`, and nothing in that list said which of them were
94
+ there to gate. The only route was `cpd.gates`, which exists on the additive
95
+ family and raises on the other three and on a node with no CPD yet, so
96
+ walking a graph for its gates meant a try/except at every node. Both new
97
+ properties are `()` on anything without gates.
98
+
99
+ ### Fixed
100
+
101
+ - **`AtMost` could draw an illegal threshold** in generation.
102
+ - **`evidence_weight_bits_range` was not the range it produced**, because the
103
+ weight is drawn first.
104
+ - **Provenance is now absent rather than wrong** where it cannot be determined,
105
+ and records the spec alongside the seed. A seed without a spec does not say
106
+ what was generated.
107
+
3
108
  ## 1.4.4
4
109
 
5
110
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: probability-flow
3
- Version: 1.4.4
3
+ Version: 1.5.0
4
4
  Summary: Discrete causal graphs and exact inference.
5
5
  Author-email: Alex Roman <dr.alexroman@gmail.com>
6
6
  License-Expression: MIT
@@ -38,7 +38,7 @@ from .serialize import FORMAT, VERSION, from_json, to_json
38
38
  from .variable import BINARY, Definition, Variable
39
39
  from .viz import render, to_text
40
40
 
41
- __version__ = "1.4.4"
41
+ __version__ = "1.5.0"
42
42
 
43
43
  __all__ = [
44
44
  "__version__",