compiled-knowledge 4.0.0a12__cp312-cp312-win_amd64.whl → 4.0.0a15__cp312-cp312-win_amd64.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.

Potentially problematic release.


This version of compiled-knowledge might be problematic. Click here for more details.

Binary file
@@ -18,19 +18,19 @@ class NamedCircuitCompiler(Enum):
18
18
  Each member itself is callable, conforming to the CircuitCompiler protocol, delegating to the compiler function.
19
19
  """
20
20
 
21
- LLVM_STACK: CircuitCompiler = (partial(llvm_compiler.compile_circuit, flavour=Flavour.STACK),)
22
- LLVM_TMPS: CircuitCompiler = (partial(llvm_compiler.compile_circuit, flavour=Flavour.TMPS, opt=0),)
23
- LLVM_VM: CircuitCompiler = (llvm_vm_compiler.compile_circuit,)
24
- CYTHON_VM: CircuitCompiler = (cython_vm_compiler.compile_circuit,)
25
- INTERPRET: CircuitCompiler = (interpret_compiler.compile_circuit,)
21
+ LLVM_STACK = (partial(llvm_compiler.compile_circuit, flavour=Flavour.STACK),)
22
+ LLVM_TMPS = (partial(llvm_compiler.compile_circuit, flavour=Flavour.TMPS, opt=0),)
23
+ LLVM_VM = (llvm_vm_compiler.compile_circuit,)
24
+ CYTHON_VM = (cython_vm_compiler.compile_circuit,)
25
+ INTERPRET = (interpret_compiler.compile_circuit,)
26
26
 
27
- # The following circuit compilers were experimental but are not really useful
27
+ # The following circuit compilers were experimental but are not really useful.
28
28
  #
29
29
  # Slow compile and execution:
30
- # LLVM_FUNCS: CircuitCompiler = (partial(llvm_compiler.compile_circuit, flavour=Flavour.FUNCS, opt=0),)
30
+ # LLVM_FUNCS = (partial(llvm_compiler.compile_circuit, flavour=Flavour.FUNCS, opt=0),)
31
31
  #
32
32
  # Slow compile and same execution as LLVM_VM:
33
- # LLVM_VM_COMPILED_ARRAYS: CircuitCompiler = (partial(llvm_vm_compiler.compile_circuit, compile_arrays=True),)
33
+ # LLVM_VM_COMPILED_ARRAYS = (partial(llvm_vm_compiler.compile_circuit, compile_arrays=True),)
34
34
 
35
35
  def __call__(
36
36
  self,
ck/example/pathfinder.py CHANGED
@@ -2,25 +2,33 @@ from ck.pgm import PGM
2
2
 
3
3
 
4
4
  class Pathfinder(PGM):
5
+ """
6
+ This implementation of the Pathfinder PGM has 93 states for the "Fault" random
7
+ variable, and its factor has been normalised to be a CPT.
8
+ """
5
9
 
6
10
  def __init__(self):
7
11
  super().__init__(self.__class__.__name__)
8
12
 
9
13
  pgm_rv0 = self.new_rv('Fault', (
10
- 'AIDS early', 'AILD', 'ALIP', 'Cat scratch disease', 'Dermatopathic laden', 'Florid follic hyperp',
11
- 'GLH hyaline vascular', 'GLH plasma cell', 'Granulomatous laden', 'Histiocytosis x', 'Infectious mono',
12
- 'Leprosy-lepromatous', 'Lymphangiographic', 'Mantle zone hyperpla', 'Necrotizing Kikuchi',
13
- 'Necrotiz non-Kikuchi', 'Rheumatoid arthritis', 'Sarcoidosis', 'SHML', 'Sinus histiocytosis', 'Syphilis',
14
- 'Toxoplasmosis', 'Tuberculosis', 'Viral NOS', "Whipple's disease", 'L&H nodular HD', 'L&H diffuse HD',
15
- 'Nodular sclerosis HD', 'Cellular phase NSHD', 'Syncytial NSHD', 'Mixed cellularity HD', 'Interfollicular HD',
16
- 'Diffuse fibrosis HD', 'Reticular-type HD', 'Small cleaved fol', 'Mixed fol', 'Large cell fol',
17
- 'Small noncleaved fol', 'Small lymphocytic', 'Plasmacytoid lyctic', 'Mantle zone lymphoma', 'Small cleaved dif',
18
- 'Mixed FCC dif', 'Large cell dif', 'B-immunoblastic', 'T-immunob mixed', 'AILD-like T-cell lym', 'Japanese ATL',
19
- 'Lymphoblastic', 'Small noncleaved dif', 'True histiocytic', 'Ki-1 LC anaplas T', 'Multiple myeloma',
20
- 'Mycosis fungoides', 'AML', 'Hairy cell leukemia', 'Carcinoma', 'Melanoma', 'EM plasmacytoma',
21
- "Kaposi's sarcoma", 'Mast-cell disease', 'AIDS involutionary', 'T-immunob large', 'Monocytoid B-cell',
22
- 'Nasopharyngeal CA', 'Seminoma', 'SLE', 'Mycobact histiocytos', 'Mast-cell hyperplas', 'LGV', 'Histoplasmosis',
23
- 'Coccidioidomycosis', 'CMV', 'Brucellosis', 'Ki-1 LC anaplas B', 'Intermed lymphocytic'))
14
+ 'AIDS early', 'AILD', 'ALIP', 'Cat scratch disease', 'Dermatopathic laden', 'Florid follic hyperp',
15
+ 'GLH hyaline vascular', 'GLH plasma cell', 'Granulomatous laden', 'Histiocytosis x', 'Infectious mono',
16
+ 'Leprosy-lepromatous', 'Lymphangiographic', 'Mantle zone hyperpla', 'Necrotizing Kikuchi',
17
+ 'Necrotiz non-Kikuchi', 'Rheumatoid arthritis', 'Sarcoidosis', 'SHML', 'Sinus histiocytosis', 'Syphilis',
18
+ 'Toxoplasmosis', 'Tuberculosis', 'Viral NOS', "Whipple's disease", 'L&H nodular HD', 'L&H diffuse HD',
19
+ 'Nodular sclerosis HD', 'Cellular phase NSHD', 'Syncytial NSHD', 'Mixed cellularity HD',
20
+ 'Interfollicular HD',
21
+ 'Diffuse fibrosis HD', 'Reticular-type HD', 'Small cleaved fol', 'Mixed fol', 'Large cell fol',
22
+ 'Small noncleaved fol', 'Small lymphocytic', 'Plasmacytoid lyctic', 'Mantle zone lymphoma',
23
+ 'Small cleaved dif',
24
+ 'Mixed FCC dif', 'Large cell dif', 'B-immunoblastic', 'T-immunob mixed', 'AILD-like T-cell lym',
25
+ 'Japanese ATL',
26
+ 'Lymphoblastic', 'Small noncleaved dif', 'True histiocytic', 'Ki-1 LC anaplas T', 'Multiple myeloma',
27
+ 'Mycosis fungoides', 'AML', 'Hairy cell leukemia', 'Carcinoma', 'Melanoma', 'EM plasmacytoma',
28
+ "Kaposi's sarcoma", 'Mast-cell disease', 'AIDS involutionary', 'T-immunob large', 'Monocytoid B-cell',
29
+ 'Nasopharyngeal CA', 'Seminoma', 'SLE', 'Mycobact histiocytos', 'Mast-cell hyperplas', 'LGV',
30
+ 'Histoplasmosis',
31
+ 'Coccidioidomycosis', 'CMV', 'Brucellosis', 'Ki-1 LC anaplas B', 'Intermed lymphocytic'))
24
32
  pgm_rv1 = self.new_rv('ACID', ('Negative', 'Positive'))
25
33
  pgm_rv2 = self.new_rv('F_CSA', ('No follicles', 'Absent', 'Present'))
26
34
  pgm_rv3 = self.new_rv('F_ISL', ('No follicles', 'Absent', 'Present'))
@@ -58,25 +66,27 @@ class Pathfinder(PGM):
58
66
  ('Absent [0]', 'Rare [1-5]', 'Few [6-25]', 'Many [26-100]', 'Striking [>100]'))
59
67
  pgm_rv34 = self.new_rv('LH_NOD', ('Absent', 'Present'))
60
68
  pgm_rv35 = self.new_rv('LACUN', (
61
- 'Absent [0]', 'Rare [1-5]', 'Few [6-25]', 'Many [26 - 100]', 'Striking [>100]', 'Sheets [>50pc of section]'))
69
+ 'Absent [0]', 'Rare [1-5]', 'Few [6-25]', 'Many [26 - 100]', 'Striking [>100]',
70
+ 'Sheets [>50pc of section]'))
62
71
  pgm_rv36 = self.new_rv('LANG', ('Absent [0]', 'Present [1-5]', 'Prominent [>5]'))
63
72
  pgm_rv37 = self.new_rv('LEUK', ('Absent', 'Present'))
64
73
  pgm_rv38 = self.new_rv('LLC_CY', ('No LLCs', 'Scanty', 'Moderate-abundant clear', 'Moderate-abundant deep'))
65
74
  pgm_rv39 = self.new_rv('LLC_NS', (
66
- 'No LLCs', 'Multilobated [some]', 'Cerebriform/Mulberry [some]', 'Convoluted [some]', 'Irregular [most]',
67
- 'Round/slightly irregular [most]'))
75
+ 'No LLCs', 'Multilobated [some]', 'Cerebriform/Mulberry [some]', 'Convoluted [some]', 'Irregular [most]',
76
+ 'Round/slightly irregular [most]'))
68
77
  pgm_rv40 = self.new_rv('LLC', (
69
- 'Absent [0pc]', 'Sparse [<10pc]', 'Moderate [11-50pc]', 'Numerous [51-90pc]', 'Striking [>90pc]'))
78
+ 'Absent [0pc]', 'Sparse [<10pc]', 'Moderate [11-50pc]', 'Numerous [51-90pc]', 'Striking [>90pc]'))
70
79
  pgm_rv41 = self.new_rv('F_POPU', (
71
- 'No follicles', '>80pc 6-12u', '>50pc 13-20u with nucleoli', '>50pc >20u with nucleoli', 'Other'))
80
+ 'No follicles', '>80pc 6-12u', '>50pc 13-20u with nucleoli', '>50pc >20u with nucleoli', 'Other'))
72
81
  pgm_rv42 = self.new_rv('MAST', ('Absent [0]', 'Present [1-50]', 'Prominent [>50]'))
73
82
  pgm_rv43 = self.new_rv('MLC', (
74
- 'Absent [0pc]', 'Sparse [<10pc]', 'Moderate [11-50pc]', 'Numerous [51-90pc]', 'Striking [>90pc]'))
83
+ 'Absent [0pc]', 'Sparse [<10pc]', 'Moderate [11-50pc]', 'Numerous [51-90pc]', 'Striking [>90pc]'))
75
84
  pgm_rv44 = self.new_rv('MELANOMA', ('Absent', 'Present'))
76
85
  pgm_rv45 = self.new_rv('MF10HP', ('0-5', '6-15', '16-50', '>50'))
77
86
  pgm_rv46 = self.new_rv('MLC_CY', ('No MLCs', 'Scanty', 'Moderate-abundant clear', 'Moderate-abundant deep'))
78
87
  pgm_rv47 = self.new_rv('MLC_NS', (
79
- 'No MLCs', 'Cerebriform [some]', 'Convoluted [some]', 'Irregular [most]', 'Round/slightly irregular [most]'))
88
+ 'No MLCs', 'Cerebriform [some]', 'Convoluted [some]', 'Irregular [most]',
89
+ 'Round/slightly irregular [most]'))
80
90
  pgm_rv48 = self.new_rv('MLC_NI', ('No MLCs', 'Absent to rare', 'Large central', 'Peripheral', 'Other'))
81
91
  pgm_rv49 = self.new_rv('MCC', ('Absent [0pc]', 'Present [<5pc]', 'Prominent [5-50pc]', 'Confluence [>50pc]'))
82
92
  pgm_rv50 = self.new_rv('MONO', ('Absent [0]', 'Rare [1-2]', 'Present [3-20]', 'Many [>20]'))
@@ -90,7 +100,8 @@ class Pathfinder(PGM):
90
100
  pgm_rv57 = self.new_rv('PAS', ('No', 'Yes'))
91
101
  pgm_rv58 = self.new_rv('PI', ('Absent', 'Present', 'Prominent'))
92
102
  pgm_rv59 = self.new_rv('PLASMA', (
93
- 'Absent [0pc]', 'Few [<5pc]', 'Moderate [6-20pc]', 'Marked [21-50pc]', 'Striking [51-90pc]', 'Sheets [>90pc]'))
103
+ 'Absent [0pc]', 'Few [<5pc]', 'Moderate [6-20pc]', 'Marked [21-50pc]', 'Striking [51-90pc]',
104
+ 'Sheets [>90pc]'))
94
105
  pgm_rv60 = self.new_rv('PC_TP', ('No plasma cells', 'Mature', 'Immature', 'Blastic', 'Pleomorphic', 'Mixed'))
95
106
  pgm_rv61 = self.new_rv('PLEO', ('Absent [0]', 'Rare [1-5]', 'Few [6-25]', 'Many [26-100]', 'Striking [>100]'))
96
107
  pgm_rv62 = self.new_rv('PFP', ('Absent', 'Present'))
@@ -101,10 +112,10 @@ class Pathfinder(PGM):
101
112
  pgm_rv67 = self.new_rv('S_RING', ('Absent', 'Present'))
102
113
  pgm_rv68 = self.new_rv('SLC_CY', ('No SLCs', 'Scanty', 'Moderate-abundant clear', 'Moderate-abundant deep'))
103
114
  pgm_rv69 = self.new_rv('SLC_NS', (
104
- 'No SLCs', 'Cerebriform [some]', 'Convoluted [some]', 'Moderate-mark irregular [most]',
105
- 'Round/slightly irregular [most]'))
115
+ 'No SLCs', 'Cerebriform [some]', 'Convoluted [some]', 'Moderate-mark irregular [most]',
116
+ 'Round/slightly irregular [most]'))
106
117
  pgm_rv70 = self.new_rv('SLC', (
107
- 'Absent [0pc]', 'Sparse [1-10pc]', 'Moderate [11-50pc]', 'Numerous [51-90pc]', 'Striking [>90pc]'))
118
+ 'Absent [0pc]', 'Sparse [1-10pc]', 'Moderate [11-50pc]', 'Numerous [51-90pc]', 'Striking [>90pc]'))
108
119
  pgm_rv71 = self.new_rv('SINUSES', ('Distended', 'Patent', 'Part-greatly obliterated', 'Completely obliterated'))
109
120
  pgm_rv72 = self.new_rv('VASC_C', ('Absent', 'Present'))
110
121
  pgm_rv73 = self.new_rv('VASC_NS', ('Absent', 'Slight', 'Moderate', 'Marked', 'Pronounced'))
@@ -123,11 +134,12 @@ class Pathfinder(PGM):
123
134
  pgm_rv86 = self.new_rv('F_SS',
124
135
  ('No follicles', 'Absent [0]', 'Slight [1-15]', 'Moderate [16-30]', 'Marked [>30]'))
125
136
  pgm_rv87 = self.new_rv('F_MZSTAT', (
126
- 'No follicles/no mantle zones', 'Mantle zones absent in most follicles', 'Most incompletely surround follicles',
127
- 'Most completely surround fol not thick', 'Most thick [>10 lymphocytes]'))
137
+ 'No follicles/no mantle zones', 'Mantle zones absent in most follicles',
138
+ 'Most incompletely surround follicles',
139
+ 'Most completely surround fol not thick', 'Most thick [>10 lymphocytes]'))
128
140
  pgm_rv88 = self.new_rv('F_MZCM', ('No follicles/no mantle zones', 'Absent', 'Present'))
129
141
  pgm_rv89 = self.new_rv('F_DEF', (
130
- 'No follicles', 'Almost all well defined', 'Both well and poor defined', 'Almost all poor defined'))
142
+ 'No follicles', 'Almost all well defined', 'Both well and poor defined', 'Almost all poor defined'))
131
143
  pgm_rv90 = self.new_rv('F_MITO', ('No follicles', '0-20', '21-50', '>50'))
132
144
  pgm_rv91 = self.new_rv('F_MZ', ('No follicles', 'Absent', 'Present'))
133
145
  pgm_rv92 = self.new_rv('F_CIO', ('No follicles', 'Most similar', 'Some similar', 'None similar'))
@@ -169,13 +181,14 @@ class Pathfinder(PGM):
169
181
  pgm_rv128 = self.new_rv('TB', ('Absent', 'Present', 'Prominent'))
170
182
  pgm_rv129 = self.new_rv('MELANIN', ('Absent to normal', 'Present', 'Prominent'))
171
183
  pgm_rv130 = self.new_rv('MC_SL_NS', (
172
- 'No follicles/no mantle zones', 'Round', 'Slightly irregular', 'Moderately irregular', 'Markedly irregular'))
184
+ 'No follicles/no mantle zones', 'Round', 'Slightly irregular', 'Moderately irregular',
185
+ 'Markedly irregular'))
173
186
  pgm_rv131 = self.new_rv('FMZ_FUS', (
174
- 'No thick mantle zones', 'No nodules no fusion', 'Nodules but no fusion', 'Fusion with or without nodules'))
187
+ 'No thick mantle zones', 'No nodules no fusion', 'Nodules but no fusion', 'Fusion with or without nodules'))
175
188
  pgm_rv132 = self.new_rv('BH_NOS_L', ('No NOS benign histiocytes', 'Mainly interfollicular', 'Mainly sinusoidal',
176
189
  'Both interfollicular and sinusoidal'))
177
190
  pgm_rv133 = self.new_rv('SLC_NI', (
178
- 'No SLCs', 'None identifiable', '1 or more peripheral small', '1 central medium to large', 'Other'))
191
+ 'No SLCs', 'None identifiable', '1 or more peripheral small', '1 central medium to large', 'Other'))
179
192
  pgm_rv134 = self.new_rv('HYALIN', ('Absent', 'Present', 'Prominent'))
180
193
  pgm_factor0 = self.new_factor(pgm_rv0)
181
194
  pgm_factor1 = self.new_factor(pgm_rv1, pgm_rv128)
@@ -315,22 +328,82 @@ class Pathfinder(PGM):
315
328
 
316
329
  pgm_function0 = pgm_factor0.set_dense()
317
330
  pgm_function0.set_flat(
318
- 20.0, 1.5, 5.0, 5.0, 25.0,
319
- 25.0, 5.0, 5.0, 15.0, 4.0,
320
- 2.0, 2.0, 5.0, 12.5, 8.0,
321
- 12.8, 2.0, 2.0, 3.0, 20.0,
322
- 2.0, 5.0, 4.0, 15.0, 0.5,
323
- 15.0, 2.5, 90.0, 8.0, 8.0,
324
- 70.0, 5.0, 3.0, 3.0, 110.0,
325
- 55.0, 20.0, 5.0, 40.0, 8.0,
326
- 10.0, 5.0, 6.0, 110.0, 20.0,
327
- 20.0, 12.0, 2.0, 10.0, 80.0,
328
- 1.0, 15.0, 2.0, 3.0, 5.0,
329
- 0.1, 20.0, 8.0, 5.0, 8.0,
330
- 2.0, 20.0, 25.0, 20.0, 5.0,
331
- 2.0, 2.0, 2.0, 2.0, 2.0,
332
- 2.0, 2.0, 5.0, 0.25, 4.0,
333
- 8.0
331
+ 0.018279029,
332
+ 0.001370927,
333
+ 0.004569757,
334
+ 0.004569757,
335
+ 0.022848787,
336
+ 0.022848787,
337
+ 0.004569757,
338
+ 0.004569757,
339
+ 0.013709272,
340
+ 0.003655806,
341
+ 0.001827903,
342
+ 0.001827903,
343
+ 0.004569757,
344
+ 0.011424393,
345
+ 0.007311612,
346
+ 0.011698579,
347
+ 0.001827903,
348
+ 0.001827903,
349
+ 0.002741854,
350
+ 0.018279029,
351
+ 0.001827903,
352
+ 0.004569757,
353
+ 0.003655806,
354
+ 0.013709272,
355
+ 0.000456976,
356
+ 0.013709272,
357
+ 0.002284879,
358
+ 0.082255632,
359
+ 0.007311612,
360
+ 0.007311612,
361
+ 0.063976603,
362
+ 0.004569757,
363
+ 0.002741854,
364
+ 0.002741854,
365
+ 0.100534662,
366
+ 0.050267331,
367
+ 0.018279029,
368
+ 0.004569757,
369
+ 0.036558059,
370
+ 0.007311612,
371
+ 0.009139515,
372
+ 0.004569757,
373
+ 0.005483709,
374
+ 0.100534662,
375
+ 0.018279029,
376
+ 0.018279029,
377
+ 0.010967418,
378
+ 0.001827903,
379
+ 0.009139515,
380
+ 0.073116118,
381
+ 0.000913951,
382
+ 0.013709272,
383
+ 0.001827903,
384
+ 0.002741854,
385
+ 0.004569757,
386
+ 9.13951E-05,
387
+ 0.018279029,
388
+ 0.007311612,
389
+ 0.004569757,
390
+ 0.007311612,
391
+ 0.001827903,
392
+ 0.018279029,
393
+ 0.022848787,
394
+ 0.018279029,
395
+ 0.004569757,
396
+ 0.001827903,
397
+ 0.001827903,
398
+ 0.001827903,
399
+ 0.001827903,
400
+ 0.001827903,
401
+ 0.001827903,
402
+ 0.001827903,
403
+ 0.004569757,
404
+ 0.000228488,
405
+ 0.003655806,
406
+ 0.007311612,
334
407
  )
335
408
 
336
409
  pgm_function1 = pgm_factor1.set_dense()
@@ -108,7 +108,7 @@ class Parser(ABC):
108
108
  except ParseError as e:
109
109
  raise e
110
110
  except Exception as e:
111
- input_stream.raise_error(e)
111
+ input_stream.raise_error(str(e))
112
112
 
113
113
  @abstractmethod
114
114
  def comment(self, raise_f, message: str) -> None:
@@ -64,10 +64,20 @@ def read_nnf_with_literal_map(
64
64
  check_header=check_header,
65
65
  optimise_ops=optimise_ops,
66
66
  )
67
+ circuit = top_node.circuit
68
+
69
+ # Build the slot map from indicator to slot.
70
+ # Some indicators may not be in `literal_slot_map` because they were not needed
71
+ # for the arithmetic circuit in the NNF file. For those indicators, we create
72
+ # dummy circuit vars.
73
+ def _get_slot(_literal_code: int) -> int:
74
+ _slot: Optional[int] = literal_slot_map.get(_literal_code)
75
+ if _slot is None:
76
+ _slot: int = circuit.new_var().idx
77
+ return _slot
67
78
 
68
- # Build the slot map from indicator to slot
69
79
  slot_map: Dict[SlotKey, int] = {
70
- indicator: literal_slot_map[literal_code]
80
+ indicator: _get_slot(literal_code)
71
81
  for literal_code, indicator in literal_map.indicators.items()
72
82
  }
73
83
 
@@ -193,7 +203,7 @@ class Parser(ABC):
193
203
  except ParseError as e:
194
204
  raise e
195
205
  except Exception as e:
196
- input_stream.raise_error(e)
206
+ input_stream.raise_error(str(e))
197
207
 
198
208
  @abstractmethod
199
209
  def comment(self, raise_f, message: str) -> None:
@@ -101,16 +101,13 @@ def compile_pgm(
101
101
  node_names: List[str] = render_bayesian_network(pgm, file, check_structure_bayesian=False)
102
102
 
103
103
  # Run Ace
104
- ace_result: subprocess.CompletedProcess = subprocess.run(ace_cmd, capture_output=True, text=True)
105
- if print_output:
106
- print(ace_result.stdout)
107
- print(ace_result.stderr)
104
+ ace_result: subprocess.CompletedProcess = subprocess.run(ace_cmd, capture_output=(not print_output), text=True)
108
105
  if ace_result.returncode != 0:
109
106
  raise subprocess.CalledProcessError(
110
107
  returncode=ace_result.returncode,
111
108
  cmd=' '.join(ace_cmd),
112
- output=ace_result.stdout,
113
- stderr=ace_result.stderr,
109
+ output=None if print_output else ace_result.stdout,
110
+ stderr=None if print_output else ace_result.stderr,
114
111
  )
115
112
 
116
113
  # Parse the literal map output from Ace
@@ -21,7 +21,7 @@ def compile_pgm(
21
21
  *,
22
22
  algorithm: JoinTreeAlgorithm = MIN_FILL_THEN_DEGREE,
23
23
  limit_product_tree_search: int = DEFAULT_PRODUCT_SEARCH_LIMIT,
24
- pre_prune_factor_tables: bool = True,
24
+ pre_prune_factor_tables: bool = False,
25
25
  ) -> PGMCircuit:
26
26
  """
27
27
  Compile the PGM to an arithmetic circuit, using factor elimination.
@@ -60,7 +60,7 @@ def compile_pgm_best_jointree(
60
60
  const_parameters: bool = True,
61
61
  *,
62
62
  limit_product_tree_search: int = DEFAULT_PRODUCT_SEARCH_LIMIT,
63
- pre_prune_factor_tables: bool = True,
63
+ pre_prune_factor_tables: bool = False,
64
64
  ) -> PGMCircuit:
65
65
  """
66
66
  Try multiple elimination heuristics, and use the join tree that has
@@ -114,7 +114,7 @@ def join_tree_to_circuit(
114
114
  join_tree: JoinTree,
115
115
  const_parameters: bool = True,
116
116
  limit_product_tree_search: int = DEFAULT_PRODUCT_SEARCH_LIMIT,
117
- pre_prune_factor_tables: bool = True,
117
+ pre_prune_factor_tables: bool = False,
118
118
  ) -> PGMCircuit:
119
119
  """
120
120
  Construct a PGMCircuit from a join-tree.
@@ -18,32 +18,32 @@ class NamedPGMCompiler(Enum):
18
18
  """
19
19
  # @formatter:off
20
20
 
21
- VE_MIN_DEGREE: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_DEGREE')
22
- VE_MIN_DEGREE_THEN_FILL: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_DEGREE_THEN_FILL')
23
- VE_MIN_FILL: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_FILL')
24
- VE_MIN_FILL_THEN_DEGREE: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_FILL_THEN_DEGREE')
25
- VE_MIN_WEIGHTED_DEGREE: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_WEIGHTED_DEGREE')
26
- VE_MIN_WEIGHTED_FILL: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_WEIGHTED_FILL')
27
- VE_MIN_TRADITIONAL_WEIGHTED_FILL: PGMCompiler = _get_compiler_algorithm(variable_elimination, 'MIN_TRADITIONAL_WEIGHTED_FILL')
28
-
29
- FE_MIN_DEGREE: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_DEGREE')
30
- FE_MIN_DEGREE_THEN_FILL: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_DEGREE_THEN_FILL')
31
- FE_MIN_FILL: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_FILL')
32
- FE_MIN_FILL_THEN_DEGREE: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_FILL_THEN_DEGREE')
33
- FE_MIN_WEIGHTED_DEGREE: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_WEIGHTED_DEGREE')
34
- FE_MIN_WEIGHTED_FILL: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_WEIGHTED_FILL')
35
- FE_MIN_TRADITIONAL_WEIGHTED_FILL: PGMCompiler = _get_compiler_algorithm(factor_elimination, 'MIN_TRADITIONAL_WEIGHTED_FILL')
36
- FE_BEST_JOINTREE: PGMCompiler = factor_elimination.compile_pgm_best_jointree,
37
-
38
- RC_MIN_DEGREE: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_DEGREE')
39
- RC_MIN_DEGREE_THEN_FILL: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_DEGREE_THEN_FILL')
40
- RC_MIN_FILL: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_FILL')
41
- RC_MIN_FILL_THEN_DEGREE: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_FILL_THEN_DEGREE')
42
- RC_MIN_WEIGHTED_DEGREE: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_WEIGHTED_DEGREE')
43
- RC_MIN_WEIGHTED_FILL: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_WEIGHTED_FILL')
44
- RC_MIN_TRADITIONAL_WEIGHTED_FILL: PGMCompiler = _get_compiler_algorithm(recursive_conditioning, 'MIN_TRADITIONAL_WEIGHTED_FILL')
45
-
46
- ACE: PGMCompiler = _get_compiler(ace)
21
+ VE_MIN_DEGREE = _get_compiler_algorithm(variable_elimination, 'MIN_DEGREE')
22
+ VE_MIN_DEGREE_THEN_FILL = _get_compiler_algorithm(variable_elimination, 'MIN_DEGREE_THEN_FILL')
23
+ VE_MIN_FILL = _get_compiler_algorithm(variable_elimination, 'MIN_FILL')
24
+ VE_MIN_FILL_THEN_DEGREE = _get_compiler_algorithm(variable_elimination, 'MIN_FILL_THEN_DEGREE')
25
+ VE_MIN_WEIGHTED_DEGREE = _get_compiler_algorithm(variable_elimination, 'MIN_WEIGHTED_DEGREE')
26
+ VE_MIN_WEIGHTED_FILL = _get_compiler_algorithm(variable_elimination, 'MIN_WEIGHTED_FILL')
27
+ VE_MIN_TRADITIONAL_WEIGHTED_FILL = _get_compiler_algorithm(variable_elimination, 'MIN_TRADITIONAL_WEIGHTED_FILL')
28
+
29
+ FE_MIN_DEGREE = _get_compiler_algorithm(factor_elimination, 'MIN_DEGREE')
30
+ FE_MIN_DEGREE_THEN_FILL = _get_compiler_algorithm(factor_elimination, 'MIN_DEGREE_THEN_FILL')
31
+ FE_MIN_FILL = _get_compiler_algorithm(factor_elimination, 'MIN_FILL')
32
+ FE_MIN_FILL_THEN_DEGREE = _get_compiler_algorithm(factor_elimination, 'MIN_FILL_THEN_DEGREE')
33
+ FE_MIN_WEIGHTED_DEGREE = _get_compiler_algorithm(factor_elimination, 'MIN_WEIGHTED_DEGREE')
34
+ FE_MIN_WEIGHTED_FILL = _get_compiler_algorithm(factor_elimination, 'MIN_WEIGHTED_FILL')
35
+ FE_MIN_TRADITIONAL_WEIGHTED_FILL = _get_compiler_algorithm(factor_elimination, 'MIN_TRADITIONAL_WEIGHTED_FILL')
36
+ FE_BEST_JOINTREE = factor_elimination.compile_pgm_best_jointree,
37
+
38
+ RC_MIN_DEGREE = _get_compiler_algorithm(recursive_conditioning, 'MIN_DEGREE')
39
+ RC_MIN_DEGREE_THEN_FILL = _get_compiler_algorithm(recursive_conditioning, 'MIN_DEGREE_THEN_FILL')
40
+ RC_MIN_FILL = _get_compiler_algorithm(recursive_conditioning, 'MIN_FILL')
41
+ RC_MIN_FILL_THEN_DEGREE = _get_compiler_algorithm(recursive_conditioning, 'MIN_FILL_THEN_DEGREE')
42
+ RC_MIN_WEIGHTED_DEGREE = _get_compiler_algorithm(recursive_conditioning, 'MIN_WEIGHTED_DEGREE')
43
+ RC_MIN_WEIGHTED_FILL = _get_compiler_algorithm(recursive_conditioning, 'MIN_WEIGHTED_FILL')
44
+ RC_MIN_TRADITIONAL_WEIGHTED_FILL = _get_compiler_algorithm(recursive_conditioning, 'MIN_TRADITIONAL_WEIGHTED_FILL')
45
+
46
+ ACE = _get_compiler(ace)
47
47
 
48
48
  # @formatter:on
49
49
 
@@ -28,7 +28,7 @@ def compile_pgm(
28
28
  const_parameters: bool = True,
29
29
  *,
30
30
  algorithm: ClusterAlgorithm = MIN_FILL_THEN_DEGREE,
31
- pre_prune_factor_tables: bool = True,
31
+ pre_prune_factor_tables: bool = False,
32
32
  ) -> PGMCircuit:
33
33
  """
34
34
  Compile the PGM to an arithmetic circuit, using recursive conditioning.
@@ -269,40 +269,48 @@ def _pre_prune_factor_tables(factor_rows: Sequence[_FactorRows]) -> None:
269
269
  will be formed, which may eliminate rows. This method identifies and removes
270
270
  such rows.
271
271
  """
272
+ # Find all pairs of factors that have at least one common random variable.
272
273
  pairs_to_check: List[_FactorPair] = [
273
274
  _FactorPair(f1, f2)
274
275
  for f1, f2 in pairs(factor_rows)
275
276
  if not set(f1.rv_indexes).isdisjoint(f1.rv_indexes)
276
277
  ]
277
278
 
278
- pairs_done: List[_FactorPair] = []
279
-
280
- while len(pairs_to_check) > 0:
281
- pair = pairs_to_check.pop()
282
- x = pair.x
283
- y = pair.y
284
-
285
- x_size = len(x)
286
- y_size = len(y)
279
+ # Simple version.
280
+ for pair in pairs_to_check:
287
281
  pair.prune()
288
282
 
289
- # See if any pairs need re-checking
290
- rvs_affected: Set[int] = set()
291
- if x_size != len(x):
292
- rvs_affected.update(x.rv_indexes)
293
- if y_size != len(y):
294
- rvs_affected.update(y.rv_indexes)
295
- if len(rvs_affected) > 0:
296
- next_pairs_done: List[_FactorPair] = []
297
- for pair in pairs_done:
298
- if rvs_affected.isdisjoint(pair.all_rv_indexes):
299
- next_pairs_done.append(pair)
300
- else:
301
- pairs_to_check.append(pair)
302
- pairs_done = next_pairs_done
303
-
304
- # Mark the current pair as done.
305
- pairs_done.append(pair)
283
+ # Earlier version.
284
+ # This version re-checks processed pairs that may get benefit from a subsequent pruning.
285
+ # Unfortunately, this is computationally expensive, and provides no practical benefit.
286
+ #
287
+ # pairs_done: List[_FactorPair] = []
288
+ # while len(pairs_to_check) > 0:
289
+ # pair: _FactorPair = pairs_to_check.pop()
290
+ # x: _FactorRows = pair.x
291
+ # y: _FactorRows = pair.y
292
+ #
293
+ # x_size = len(x)
294
+ # y_size = len(y)
295
+ # pair.prune()
296
+ #
297
+ # # See if any pairs need re-checking
298
+ # rvs_affected: Set[int] = set()
299
+ # if x_size != len(x):
300
+ # rvs_affected.update(x.rv_indexes)
301
+ # if y_size != len(y):
302
+ # rvs_affected.update(y.rv_indexes)
303
+ # if len(rvs_affected) > 0:
304
+ # next_pairs_done: List[_FactorPair] = []
305
+ # for pair in pairs_done:
306
+ # if rvs_affected.isdisjoint(pair.all_rv_indexes):
307
+ # next_pairs_done.append(pair)
308
+ # else:
309
+ # pairs_to_check.append(pair)
310
+ # pairs_done = next_pairs_done
311
+ #
312
+ # # Mark the current pair as done.
313
+ # pairs_done.append(pair)
306
314
 
307
315
 
308
316
  def _make_factor_table(
@@ -25,7 +25,7 @@ def compile_pgm(
25
25
  const_parameters: bool = True,
26
26
  *,
27
27
  algorithm: ClusterAlgorithm = MIN_FILL_THEN_DEGREE,
28
- pre_prune_factor_tables: bool = True,
28
+ pre_prune_factor_tables: bool = False,
29
29
  ) -> PGMCircuit:
30
30
  """
31
31
  Compile the PGM to an arithmetic circuit, using variable elimination.
ck_demos/ace/demo_ace.py CHANGED
@@ -17,7 +17,7 @@ def main() -> None:
17
17
  # Here is an example showing how to copy Ace to the default
18
18
  # location from a source directory.
19
19
  #
20
- # ace.copy_ace_to_default_location(r'E:\Dropbox\Research\Ace\all')
20
+ # ace.copy_ace_to_default_location(r'C:\Research\Ace\ace_v3.0_windows')
21
21
 
22
22
  pgm_cct: PGMCircuit = ace.compile_pgm(pgm, print_output=True)
23
23
 
@@ -9,6 +9,14 @@ from ck_demos.utils.compare import compare
9
9
 
10
10
  # @formatter:off
11
11
 
12
+ # =========================================
13
+ # Experiment configuration
14
+ # =========================================
15
+
16
+ CACHE_CIRCUITS: bool = True
17
+ BREAK_BETWEEN_PGMS: bool = True
18
+ COMMA_NUMBERS: bool = True
19
+
12
20
  PGMS: Sequence[PGM] = [
13
21
  example.Rain(),
14
22
  example.Cancer(),
@@ -25,14 +33,14 @@ PGMS: Sequence[PGM] = [
25
33
  # example.Mildew(),
26
34
  ]
27
35
 
28
- CCT_COMPILERS: Sequence[NamedCircuitCompiler] = [DEFAULT_CIRCUIT_COMPILER]
29
-
30
36
  PGM_COMPILERS: Sequence[NamedPGMCompiler] = [
31
37
  named_compiler
32
38
  for named_compiler in NamedPGMCompiler
33
39
  if named_compiler.name.startswith('FE_') and 'WEIGHTED' not in named_compiler.name
34
40
  ] + [NamedPGMCompiler.ACE]
35
41
 
42
+ CCT_COMPILERS: Sequence[NamedCircuitCompiler] = [DEFAULT_CIRCUIT_COMPILER]
43
+
36
44
  # @formatter:on
37
45
 
38
46
 
@@ -41,6 +49,9 @@ def main() -> None:
41
49
  pgms=PGMS,
42
50
  pgm_compilers=PGM_COMPILERS,
43
51
  cct_compilers=CCT_COMPILERS,
52
+ cache_circuits=CACHE_CIRCUITS,
53
+ break_between_pgms=BREAK_BETWEEN_PGMS,
54
+ comma_numbers=COMMA_NUMBERS,
44
55
  )
45
56
  print()
46
57
  print('Done.')
ck_demos/utils/compare.py CHANGED
@@ -7,13 +7,15 @@ from ck.pgm_circuit.wmc_program import WMCProgram
7
7
  from ck.pgm_compiler import NamedPGMCompiler
8
8
  from ck_demos.utils.stop_watch import StopWatch
9
9
 
10
- CACHE_CIRCUIT: bool = True
11
-
12
10
 
13
11
  def compare(
14
12
  pgms: Sequence[PGM],
15
13
  pgm_compilers: Sequence[NamedPGMCompiler],
16
14
  cct_compilers: Sequence[NamedCircuitCompiler],
15
+ *,
16
+ cache_circuits: bool = True,
17
+ break_between_pgms: bool = True,
18
+ comma_numbers: bool = True,
17
19
  ) -> None:
18
20
  """
19
21
  For each combination of the given arguments, construct a PGMCircuit (using a
@@ -35,22 +37,34 @@ def compare(
35
37
  pgms: a sequence of PGM objects.
36
38
  pgm_compilers: a sequence of named PGM compilers.
37
39
  cct_compilers: a sequence of named circuit compilers.
40
+ cache_circuits: if true, then circuits are reused across different circuit compilers.
41
+ break_between_pgms: if true, print a blank line between different workload PGMs.
42
+ comma_numbers: if true, commas are used in large numbers.
38
43
  """
39
- # work out column widths for names.
40
- max_pgm_name: int = max(len(pgm.name) for pgm in pgms)
41
- max_pgm_compiler_name: int = max(len(pgm_compiler.name) for pgm_compiler in pgm_compilers)
42
- max_cct_compiler_name: int = max(len(cct_compiler.name) for cct_compiler in cct_compilers)
44
+ # Work out column widths for names.
45
+ col_pgm_name: int = max(len(pgm.name) for pgm in pgms)
46
+ col_pgm_compiler_name: int = max(len(pgm_compiler.name) for pgm_compiler in pgm_compilers)
47
+ col_cct_compiler_name: int = max(len(cct_compiler.name) for cct_compiler in cct_compilers)
48
+ col_cct_ops: int = 10
49
+ col_pgm_compile_time: int = 10
50
+ col_cct_compile_time: int = 10
51
+ col_execute_time: int = 10
43
52
 
44
- # variables for when CACHE_CIRCUIT is true
53
+ # Variables for when cache_circuits is true
45
54
  prev_pgm = None
46
55
  prev_pgm_compiler = None
47
56
 
57
+ if comma_numbers:
58
+ comma = ','
59
+ else:
60
+ comma = ''
61
+
48
62
  for pgm in pgms:
49
- pgm_name: str = pgm.name.ljust(max_pgm_name)
63
+ pgm_name: str = pgm.name.ljust(col_pgm_name)
50
64
  for pgm_compiler in pgm_compilers:
51
- pgm_compiler_name: str = pgm_compiler.name.ljust(max_pgm_compiler_name)
65
+ pgm_compiler_name: str = pgm_compiler.name.ljust(col_pgm_compiler_name)
52
66
  for cct_compiler in cct_compilers:
53
- cct_compiler_name: str = cct_compiler.name.ljust(max_cct_compiler_name)
67
+ cct_compiler_name: str = cct_compiler.name.ljust(col_cct_compiler_name)
54
68
 
55
69
  print(f'{pgm_name} ', end='')
56
70
  print(f'{pgm_compiler_name} ', end='')
@@ -59,30 +73,34 @@ def compare(
59
73
  try:
60
74
  time = StopWatch()
61
75
 
62
- if CACHE_CIRCUIT and pgm is prev_pgm and pgm_compiler is prev_pgm_compiler:
63
- print(f'{"":10} ', end='')
64
- print(f'{"":10} ', end='')
76
+ if cache_circuits and pgm is prev_pgm and pgm_compiler is prev_pgm_compiler:
77
+ print(f'{"":{col_cct_ops}} ', end='')
78
+ print(f'{"":{col_pgm_compile_time}} ', end='')
65
79
  else:
66
80
  time.start()
67
81
  pgm_cct: PGMCircuit = pgm_compiler(pgm)
68
82
  time.stop()
69
- print(f'{pgm_cct.circuit_top.circuit.number_of_operations:10,} ', end='')
70
- print(f'{time.seconds():10.3f}s ', end='')
83
+ num_ops: int = pgm_cct.circuit_top.circuit.number_of_operations
84
+ print(f'{num_ops:{col_cct_ops}{comma}} ', end='')
85
+ print(f'{time.seconds():{col_pgm_compile_time}{comma}.3f} ', end='')
71
86
  prev_pgm = pgm
72
87
  prev_pgm_compiler = pgm_compiler
73
88
 
74
89
  time.start()
90
+ # `pgm_cct` will always be set but the IDE can't work that out.
91
+ # noinspection PyUnboundLocalVariable
75
92
  wmc = WMCProgram(pgm_cct, compiler=cct_compiler.compiler)
76
93
  time.stop()
77
- print(f'{time.seconds():10.3f}s ', end='')
94
+ print(f'{time.seconds():{col_cct_compile_time}{comma}.3f} ', end='')
78
95
 
79
96
  time.start()
80
97
  for _ in range(1000):
81
98
  wmc.compute()
82
99
  time.stop()
83
- print(f'{time.seconds() * 1000:10.3f}μs ', end='')
100
+ print(f'{time.seconds() * 1000:{col_execute_time}{comma}.3f} ', end='')
84
101
  except Exception as err:
85
102
  print(repr(err), end='')
86
103
 
87
104
  print()
88
- print()
105
+ if break_between_pgms:
106
+ print()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compiled-knowledge
3
- Version: 4.0.0a12
3
+ Version: 4.0.0a15
4
4
  Summary: A Python package for compiling and querying discrete probabilistic graphical models.
5
5
  Author-email: Barry Drake <barry@compiledknowledge.org>
6
6
  License-Expression: MIT
@@ -43,7 +43,7 @@ Refer to the project online documentation at
43
43
  The primary repository for the project is
44
44
  [github.com/ropeless/compiled_knowledge](https://github.com/ropeless/compiled_knowledge).
45
45
 
46
- The Python package is available on PyPi, see
46
+ The Python package is available on PyPI, see
47
47
  [pypi.org/project/compiled-knowledge](https://pypi.org/project/compiled-knowledge/).
48
48
 
49
49
  For more information email
@@ -2,7 +2,7 @@ ck/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  ck/pgm.py,sha256=rbqgP-clfSvgpzUXxVjk_6SdM9neHmpChku6qpyeidk,120700
3
3
  ck/circuit/__init__.py,sha256=tozFNNVzsgQDwFrtGzrgcFS4XTszhgyFmbMGfV5pimc,212
4
4
  ck/circuit/circuit.c,sha256=_DN78mWLcGdXOKoZv6Eq-m50KLpOP0SY_GjFrhLJoj0,1773051
5
- ck/circuit/circuit.cp312-win_amd64.pyd,sha256=AEIxR4g_x4BvVsJw3U_Gv0RqQXA3M5ryM-rHiTgo5qI,252416
5
+ ck/circuit/circuit.cp312-win_amd64.pyd,sha256=TCkj4oiRcRFb0av5YyizlygbYKtFJn8LAqjT7nO8Zjw,252416
6
6
  ck/circuit/circuit.pyx,sha256=Y35CZMalySX8_uhNH6wIaZzS6ACn3rh3L99bog1lQx8,28060
7
7
  ck/circuit/circuit_node.pyx,sha256=8RuEC1ngYxnsGryzQ1lOEPc4ewTxvKwc56sOxWLB9zs,4103
8
8
  ck/circuit/circuit_py.py,sha256=_k8H1yZsfp2vERkX_CIo8VxxOf1ICw2zL8i2ckoaSlE,28127
@@ -12,10 +12,10 @@ ck/circuit_compiler/circuit_compiler.py,sha256=8BLB8DUnPbpl5PXZsIopydPbItytdn2rz
12
12
  ck/circuit_compiler/interpret_compiler.py,sha256=Vlu4VnZ_VWGoBb4yx6wuJOlhJ2nGVhkzQpIyJ8xyjbI,7350
13
13
  ck/circuit_compiler/llvm_compiler.py,sha256=ejeNPkO5Og2FyjjyA5JAexxUl1f8IJ6mwU5Ng5EafAA,14009
14
14
  ck/circuit_compiler/llvm_vm_compiler.py,sha256=I46_XV5FrClDKO06zIjn8T3ME5XQ9RYJ_1aAE8e_YzM,21873
15
- ck/circuit_compiler/named_circuit_compilers.py,sha256=Fsk2HANYhw25uxAdOo5-7aSnVZxlPgsaPz9wO_1YdRg,2400
15
+ ck/circuit_compiler/named_circuit_compilers.py,sha256=gKhRvYLflSCkk6CBI-CBQ2UwR-bhEhMxLvnefPm8288,2282
16
16
  ck/circuit_compiler/cython_vm_compiler/__init__.py,sha256=pEAwTleuZgdYhTAQMea2f9YsFK54eoNbZSbrWkW8aeE,49
17
17
  ck/circuit_compiler/cython_vm_compiler/_compiler.c,sha256=xpYybtj-aRcMJV1oKkB-p0kciZVW3gLRd0OJBfDg3sc,757006
18
- ck/circuit_compiler/cython_vm_compiler/_compiler.cp312-win_amd64.pyd,sha256=Ddr_g8kTVwQ6CDq0pZGUX-2E4KGZYcuuWFsUBsdtAtw,92160
18
+ ck/circuit_compiler/cython_vm_compiler/_compiler.cp312-win_amd64.pyd,sha256=hq07LvGfpD8VsssyCmmbecF38YCIws2efly317jvPug,92160
19
19
  ck/circuit_compiler/cython_vm_compiler/_compiler.pyx,sha256=hHuNo99TbodNpWgQwQ8qzW1cTwGXZj5SW0tKAo9u6cw,7718
20
20
  ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py,sha256=yUkBNr5HnoVXyWjJdXHp8lyAXFiIDYapvMvHtzKuhI8,3140
21
21
  ck/circuit_compiler/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -41,7 +41,7 @@ ck/example/insurance.py,sha256=Nq8WqpMtWgYv8XgTQo3iL2DzDu-PdmsJBL6fpQjOI-0,31708
41
41
  ck/example/loop.py,sha256=9Au9FABY_0X7W-6M4vQljepul010vMIMOh9OA6be14w,1451
42
42
  ck/example/mildew.py,sha256=qblE1Fx_P_eYJqu_uptwoCUvIDXhGmO67G6sHLSu0zc,1830957
43
43
  ck/example/munin.py,sha256=HbkEOqzq9ZrYzm4uSSOnfVv_rt_NDxmN7Wy4JwDf3Z0,1680209
44
- ck/example/pathfinder.py,sha256=BxEg-peUzg6vHVopqlL6pUdNcEUfcO7PFhg38_TbRXU,2309107
44
+ ck/example/pathfinder.py,sha256=U1RHp0L6OzdfL4Dh0x6CAb9eMqd6kzkuLavvc16BCjg,2310872
45
45
  ck/example/rain.py,sha256=el8cOP51IKjDXw_F4dnh0FIqI5xw0qFRdmg-GyFymsE,1226
46
46
  ck/example/rectangle.py,sha256=srcBu90-RsMqYtRKngVxdXS8OQDMIiucx78VcFyN49M,6995
47
47
  ck/example/run.py,sha256=HHCfHwrkRCSuplV2msXuZ3azkgC4bjtN8C5cL6UWtp0,994
@@ -54,8 +54,8 @@ ck/example/survey.py,sha256=KrqDgzU1V-yJHy4BEAAJQatqH9YAy8acrp6rVYAqQag,1611
54
54
  ck/example/triangle_square.py,sha256=D-ADGOSxCffsgukLTySsb6HVQpUnOJ-ZyMGBz_qGna4,2148
55
55
  ck/example/truss.py,sha256=5ud1qvPZMSKqSx0Sq1ZKcEeD_ZVUdKbEBfk5eyqhpm4,1974
56
56
  ck/in_out/__init__.py,sha256=PKhy5qeUrmmUaECSQIkoLQ2McAfQFSwB06vQZk3vpmo,112
57
- ck/in_out/parse_ace_lmap.py,sha256=JAwYL4TDlO4GhJmg-v8-3hl67lYyKYLKSvQUI8mTvgw,7886
58
- ck/in_out/parse_ace_nnf.py,sha256=7O8B5LdoICq0nFAAZfHK-mWkuzrGY_h2WOaNzLghCWw,11403
57
+ ck/in_out/parse_ace_lmap.py,sha256=EZnSLhsZwdPnk2Fbe2El0YXYqvjd_cBh7PZro7ZeR04,7891
58
+ ck/in_out/parse_ace_nnf.py,sha256=Hkc24qn4ziA4-VunBEinURDGsnmCWICj73w3bopecR0,11843
59
59
  ck/in_out/parse_net.py,sha256=cBY7X4k5U8v9x_dtFZWdOpSPh-q-U47gdImNo2Tf9dY,14302
60
60
  ck/in_out/parser_utils.py,sha256=Js_BaOmNji4mM7UYDm6pGd56wYcQoere7TuB0tkztko,5440
61
61
  ck/in_out/pgm_pickle.py,sha256=i5LYxez356we7MzHwsQBmFdOvBJOLVKBp4u4lSwBOjU,1004
@@ -74,21 +74,21 @@ ck/pgm_circuit/wmc_program.py,sha256=WtABU74FOCCJuKRCoDL4CyZ4CJXFmt9RSxiNNHsOhRY
74
74
  ck/pgm_circuit/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  ck/pgm_circuit/support/compile_circuit.py,sha256=RuYzDCRpfXZcY96sSW8v7x6ev9ScQ4IZkVqMdJUoMp8,3484
76
76
  ck/pgm_compiler/__init__.py,sha256=XCK1AWBBB9UYi6kbFnxMFzBL9a25EWfHnz_yn3ZKYuM,112
77
- ck/pgm_compiler/factor_elimination.py,sha256=iZe7Y-YIm0P9I-h4jLomUS49QiEedAbWQ1btU5JRBLg,13244
78
- ck/pgm_compiler/named_pgm_compilers.py,sha256=zqRR8gER4zhl_RjXPHy8U0j5G-bQhYQZuG9hWptAHms,3720
77
+ ck/pgm_compiler/factor_elimination.py,sha256=Eu7wJWYjRK4aTEsJP4P_femktbqqZkWN3aI-nqHyNzU,13247
78
+ ck/pgm_compiler/named_pgm_compilers.py,sha256=kYMomYlsW7xbL0hzTWQb41EckkugaCfuYHUJqbEWBBs,3421
79
79
  ck/pgm_compiler/pgm_compiler.py,sha256=F44PtlwqMG0FS6KzOYKZuyZT6olWAVtBH-QXZPzz4O8,616
80
- ck/pgm_compiler/recursive_conditioning.py,sha256=dlLAKdV7KUf7hHRVIndBsMC1bGUvrOCXeOY0vGs6yHE,7935
81
- ck/pgm_compiler/variable_elimination.py,sha256=wNNntrng2OGSsnGHWr8cLHsMHDQgJodQxhu6h7RMung,3459
80
+ ck/pgm_compiler/recursive_conditioning.py,sha256=U0NdIns8yLQtYR_MOf1w__CChpOMDlgRCL2nFRhtnzU,7936
81
+ ck/pgm_compiler/variable_elimination.py,sha256=YNBurWTz8_BoaZgRZFj-T9gRVGek7ZutGkvjegyLkCM,3460
82
82
  ck/pgm_compiler/ace/__init__.py,sha256=BkZXAF32Pk8QU7jhkuKvHqtsFasPjf8gxiZbyrGDDbQ,82
83
- ck/pgm_compiler/ace/ace.py,sha256=SpOX8s0PsNP0I9X5_TagHo5Gh4kZYxciKuEQbuvpyE4,10131
83
+ ck/pgm_compiler/ace/ace.py,sha256=Q3d76rwAMsNFQeRXdxycy_KUJeE29g7bURryKAdq-aI,10095
84
84
  ck/pgm_compiler/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
85
  ck/pgm_compiler/support/clusters.py,sha256=96Up5XUgERh-t6KzSIOF2gtP5T4Ul83JK_aPtIR72Ic,20821
86
- ck/pgm_compiler/support/factor_tables.py,sha256=LAZbWtDVyTpxps7C4d3q38uUVkNnzRBO8JpYl9Qly-c,15081
86
+ ck/pgm_compiler/support/factor_tables.py,sha256=N7BNBBA-BX6RN-eiDwENtMLczW3JAkV-qW0i0k8OZEM,15558
87
87
  ck/pgm_compiler/support/join_tree.py,sha256=tRHev655cwRsOSyLK9HYwfX8EEkubmlg1fw748Kztb4,10418
88
88
  ck/pgm_compiler/support/named_compiler_maker.py,sha256=tQ79JOI8MknAziUiFhFGV9n4y6PPKrnbq3-quMmnrwY,974
89
89
  ck/pgm_compiler/support/circuit_table/__init__.py,sha256=eWMP5ywgd51RJexKkhcpKJb_8iEluL0C4_hyOpzlAvQ,167
90
90
  ck/pgm_compiler/support/circuit_table/circuit_table.c,sha256=aO3bq3V-FwbmJDzWVYwigOFeQUC6gFz-nAq091XQp2E,702527
91
- ck/pgm_compiler/support/circuit_table/circuit_table.cp312-win_amd64.pyd,sha256=O5PF35hHGlDg_00hn5Cdy_idn_1JxEbjAQKldDC7_Qk,94720
91
+ ck/pgm_compiler/support/circuit_table/circuit_table.cp312-win_amd64.pyd,sha256=eVXmnKKG8k-V0v_RfhH9_n8nHfB6zZtC5LPDAvHitY0,94720
92
92
  ck/pgm_compiler/support/circuit_table/circuit_table.pyx,sha256=jhzstay-3EUgu0CIbWKd0eNDNToX1tmm9IQxk0ZgpYM,11904
93
93
  ck/pgm_compiler/support/circuit_table/circuit_table_py.py,sha256=1WFCxgBFu4oaYRCdk_1uXeufFQu6PqMOsYIQ_SkXDS4,10156
94
94
  ck/probability/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -120,7 +120,7 @@ ck_demos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
120
  ck_demos/all_demos.py,sha256=E1SZDvG0l_j1PfHZLemHocezw10uY5uGl3yE3BX87DE,2556
121
121
  ck_demos/ace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
122
  ck_demos/ace/copy_ace_to_ck.py,sha256=TJHPGcUbd1a6OjH3Fw7c3fno8ULPbf5p3V_lBmiNR-k,303
123
- ck_demos/ace/demo_ace.py,sha256=68Q27XFpGaj_bUZuQ35-p2jpqgFN9zVWKLuA_dWBQRw,1360
123
+ ck_demos/ace/demo_ace.py,sha256=yF35GsYtFZxzTFqXlD_yoEg25BA8wROB5HbuOaxLPUs,1365
124
124
  ck_demos/circuit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
125
  ck_demos/circuit/demo_circuit_dump.py,sha256=CQC5cxXaaRuVZ3d8h-SqXs8EJo0Tm5H5l7T9ad6pyEk,458
126
126
  ck_demos/circuit/demo_derivatives.py,sha256=3JoWVAEKLEoLjq6QzWkq4Z-qVq1l0tHvGDn5erVuozc,1186
@@ -133,7 +133,7 @@ ck_demos/pgm/demo_pgm_dump_stress.py,sha256=L9S3yp0EQM56kWztV4A6XzEqITOGbThImZIU
133
133
  ck_demos/pgm/demo_pgm_string_rendering.py,sha256=JTf_M6pPwl9RtOLlpJFQIgNgGuHnsddJbxhgbZOChos,285
134
134
  ck_demos/pgm/show_examples.py,sha256=KxK37hKqWD9w9k9RoMCdJgkBIMePf8udQbqaFs-s91c,461
135
135
  ck_demos/pgm_compiler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
- ck_demos/pgm_compiler/compare_pgm_compilers.py,sha256=UQtMa_z4EQIZKjFpm-QCiAZrDmT4BJxr9GZuxsQQoYM,1209
136
+ ck_demos/pgm_compiler/compare_pgm_compilers.py,sha256=0dm77DygI9E4WMOAD-M8Kzrf4xlPmZuZX6zUdy5fZ4Y,1548
137
137
  ck_demos/pgm_compiler/demo_compiler_dump.py,sha256=OlLJi1wwdFQxave5lpceyVx0-ihHEn2-d-0XFFTjowY,1370
138
138
  ck_demos/pgm_compiler/demo_factor_elimination.py,sha256=KDzYwNZJ9HTcPoNxg6lxFoaXJ26QW-nnBI-0Ux_yWoM,1320
139
139
  ck_demos/pgm_compiler/demo_join_tree.py,sha256=E7ZqFrRuAmnSRmBTDqNGxD-KFlHOtd_jIju8UJssUfM,574
@@ -161,12 +161,12 @@ ck_demos/sampling/demo_marginal_direct_sampler.py,sha256=RhNunuIUnYI_GXp9m8wzadM
161
161
  ck_demos/sampling/demo_uniform_sampler.py,sha256=Z6tX_OYKGLc_w3-kEPK4KEZlJo7F5HOq_tUVppB_VQE,962
162
162
  ck_demos/sampling/demo_wmc_direct_sampler.py,sha256=c7maxTmZyIijaVdFs2h_KQbK30LvI-oCm2BXSUXVoD8,1113
163
163
  ck_demos/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
164
- ck_demos/utils/compare.py,sha256=eC1rJXuWQhEfq4yQlXggn2O_sk-xAVEn6PpVuIaZJoo,3447
164
+ ck_demos/utils/compare.py,sha256=WGCYv6rbT_vU1ldndnIoflmF2EDAQ2ckCw2i2QVVPng,4357
165
165
  ck_demos/utils/convert_network.py,sha256=TSKj8q7L7J5rhrvwjaDkdYZ0Sg8vV5FRL_vCanX1CQw,1363
166
166
  ck_demos/utils/sample_model.py,sha256=in-Nlv-iuNIu6y9fDuMyo7nzgimBuTAnCWcpnVqvqDQ,8839
167
167
  ck_demos/utils/stop_watch.py,sha256=VzXHRWx0V8vPSD-bLgLlEYkCkR2FA0-KmM_pfKx-Pxo,13205
168
- compiled_knowledge-4.0.0a12.dist-info/licenses/LICENSE.txt,sha256=uMYx7tmroEKNASizbCOwPveMQsD5UErLDC1_SANmNn8,1089
169
- compiled_knowledge-4.0.0a12.dist-info/METADATA,sha256=YTNCVL1c9vIe7N3_YyKMfchNdM76LEIni9yJv3dvegw,1838
170
- compiled_knowledge-4.0.0a12.dist-info/WHEEL,sha256=b7PoVIxzH_MOHKjftqMzQiGKfdHRlRFepVBVPg0y3vc,101
171
- compiled_knowledge-4.0.0a12.dist-info/top_level.txt,sha256=Cf8DAfd2vcnLiA7HlxoduOzV0Q-8surE3kzX8P9qdks,12
172
- compiled_knowledge-4.0.0a12.dist-info/RECORD,,
168
+ compiled_knowledge-4.0.0a15.dist-info/licenses/LICENSE.txt,sha256=uMYx7tmroEKNASizbCOwPveMQsD5UErLDC1_SANmNn8,1089
169
+ compiled_knowledge-4.0.0a15.dist-info/METADATA,sha256=2pLUAaU9vrC3iWkLGsj6SPKfKQDSZ8UL2eBh9xdkF4k,1838
170
+ compiled_knowledge-4.0.0a15.dist-info/WHEEL,sha256=b7PoVIxzH_MOHKjftqMzQiGKfdHRlRFepVBVPg0y3vc,101
171
+ compiled_knowledge-4.0.0a15.dist-info/top_level.txt,sha256=Cf8DAfd2vcnLiA7HlxoduOzV0Q-8surE3kzX8P9qdks,12
172
+ compiled_knowledge-4.0.0a15.dist-info/RECORD,,