compiled-knowledge 4.1.0a1__tar.gz → 4.1.0a2__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.
Potentially problematic release.
This version of compiled-knowledge might be problematic. Click here for more details.
- {compiled_knowledge-4.1.0a1/src/compiled_knowledge.egg-info → compiled_knowledge-4.1.0a2}/PKG-INFO +1 -1
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/pyproject.toml +1 -1
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/cross_table.py +2 -2
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/dataset.py +50 -33
- compiled_knowledge-4.1.0a2/src/ck/dataset/dataset_builder.py +512 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/dataset_from_csv.py +5 -1
- compiled_knowledge-4.1.0a2/src/ck_demos/dataset/demo_dataset_builder.py +37 -0
- compiled_knowledge-4.1.0a2/src/ck_demos/utils/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2/src/compiled_knowledge.egg-info}/PKG-INFO +1 -1
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/compiled_knowledge.egg-info/SOURCES.txt +3 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/LICENSE.txt +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/MANIFEST.in +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/README.md +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/setup.cfg +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/setup.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit/_circuit_cy.c +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit/_circuit_cy.pxd +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit/_circuit_cy.pyx +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit/_circuit_py.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit/tmp_const.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/circuit_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/cython_vm_compiler/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/cython_vm_compiler/_compiler.c +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/cython_vm_compiler/_compiler.pyx +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/interpret_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/llvm_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/llvm_vm_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/named_circuit_compilers.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/circuit_analyser/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.pyx +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_py.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/input_vars.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/circuit_compiler/support/llvm_ir_function.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/cross_table_probabilities.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/dataset_compute.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/dataset_from_crosstable.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/dataset/sampled_dataset.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/alarm.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/asia.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/binary_clique.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/bow_tie.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/cancer.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/chain.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/child.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/clique.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/cnf_pgm.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/diamond_square.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/earthquake.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/empty.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/hailfinder.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/hepar2.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/insurance.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/loop.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/mildew.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/munin.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/pathfinder.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/rain.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/rectangle.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/run.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/sachs.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/sprinkler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/star.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/stress.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/student.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/survey.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/triangle_square.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/example/truss.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/parse_ace_lmap.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/parse_ace_nnf.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/parse_net.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/parser_utils.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/pgm_pickle.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/pgm_python.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/render_bugs.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/render_net.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/in_out/render_pomegranate.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/learning/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/learning/train_generative.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/marginals_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/mpe_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/pgm_circuit.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/program_with_slotmap.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/slot_map.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/support/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/support/compile_circuit.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/target_marginals_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_circuit/wmc_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/ace/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/ace/ace.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/factor_elimination.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/named_pgm_compilers.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/pgm_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/recursive_conditioning.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/circuit_table/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_cy.pyx +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_py.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/clusters.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/factor_tables.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/join_tree.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/support/named_compiler_maker.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/pgm_compiler/variable_elimination.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/probability/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/probability/empirical_probability_space.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/probability/pgm_probability_space.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/probability/probability_space.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/program/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/program/program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/program/program_buffer.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/program/raw_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/forward_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/marginals_direct_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/sampler_support.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/uniform_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/wmc_direct_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/wmc_gibbs_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/wmc_metropolis_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/sampling/wmc_rejection_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/iter_extras.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/local_config.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/map_list.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/map_set.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/np_extras.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/random_extras.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck/utils/tmp_dir.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/ace/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/ace/copy_ace_to_ck.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/ace/demo_ace.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/ace/simple_ace_demo.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/all_demos.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/circuit/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/circuit/demo_circuit_dump.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/circuit/demo_derivatives.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/circuit_compiler/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/circuit_compiler/compare_circuit_compilers.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/circuit_compiler/show_llvm_program.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/getting_started → compiled_knowledge-4.1.0a2/src/ck_demos/dataset}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/pgm → compiled_knowledge-4.1.0a2/src/ck_demos/getting_started}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/getting_started/simple_demo.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/pgm_compiler → compiled_knowledge-4.1.0a2/src/ck_demos/pgm}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm/demo_pgm_dump.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm/demo_pgm_dump_stress.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm/demo_pgm_string_rendering.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm/show_examples.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/pgm_inference → compiled_knowledge-4.1.0a2/src/ck_demos/pgm_compiler}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/compare_pgm_compilers.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_compiler_dump.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_factor_elimination.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_join_tree.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_marginals_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_mpe_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_pgm_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_recursive_conditioning.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_variable_elimination.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/demo_wmc_program.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_compiler/time_fe_compiler.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/programs → compiled_knowledge-4.1.0a2/src/ck_demos/pgm_inference}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_inference/demo_inferencing_basic.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_inference/demo_inferencing_mpe_cancer.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_inference/demo_inferencing_wmc_and_mpe_sprinkler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/pgm_inference/demo_inferencing_wmc_student.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/sampling → compiled_knowledge-4.1.0a2/src/ck_demos/programs}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_program_buffer.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_program_multi.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_program_none.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_program_single.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_raw_program_dump.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_raw_program_interpreted.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/programs/demo_raw_program_llvm.py +0 -0
- {compiled_knowledge-4.1.0a1/src/ck_demos/utils → compiled_knowledge-4.1.0a2/src/ck_demos/sampling}/__init__.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/sampling/check_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/sampling/demo_marginal_direct_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/sampling/demo_uniform_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/sampling/demo_wmc_direct_sampler.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/utils/compare.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/utils/convert_network.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/utils/sample_model.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/ck_demos/utils/stop_watch.py +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/compiled_knowledge.egg-info/dependency_links.txt +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/compiled_knowledge.egg-info/requires.txt +0 -0
- {compiled_knowledge-4.1.0a1 → compiled_knowledge-4.1.0a2}/src/compiled_knowledge.egg-info/top_level.txt +0 -0
|
@@ -66,7 +66,7 @@ class CrossTable(MutableMapping[Instance, float]):
|
|
|
66
66
|
|
|
67
67
|
def __setitem__(self, key: Instance, value) -> None:
|
|
68
68
|
if value == 0:
|
|
69
|
-
self._dict.pop(key
|
|
69
|
+
self._dict.pop(key)
|
|
70
70
|
else:
|
|
71
71
|
self._dict[key] = value
|
|
72
72
|
|
|
@@ -238,7 +238,7 @@ def cross_table_from_hard_dataset(
|
|
|
238
238
|
weights: CrossTable = CrossTable(rvs, dirichlet_prior)
|
|
239
239
|
|
|
240
240
|
columns: List[NDArray] = [
|
|
241
|
-
dataset.
|
|
241
|
+
dataset.state_idxs(rv)
|
|
242
242
|
for rv in rvs
|
|
243
243
|
]
|
|
244
244
|
|
|
@@ -5,7 +5,7 @@ from typing import Sequence, Optional, Dict, Iterable, Tuple
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
7
|
from ck.pgm import RandomVariable, State
|
|
8
|
-
from ck.utils.np_extras import
|
|
8
|
+
from ck.utils.np_extras import DTypeStates, dtype_for_number_of_states, NDArrayNumeric, NDArrayStates
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Dataset:
|
|
@@ -17,7 +17,7 @@ class Dataset:
|
|
|
17
17
|
|
|
18
18
|
def __init__(
|
|
19
19
|
self,
|
|
20
|
-
weights: Optional[
|
|
20
|
+
weights: Optional[NDArrayNumeric | Sequence],
|
|
21
21
|
length: Optional[int],
|
|
22
22
|
):
|
|
23
23
|
# Infer the length of the dataset.
|
|
@@ -30,14 +30,16 @@ class Dataset:
|
|
|
30
30
|
self._rvs: Tuple[RandomVariable, ...] = ()
|
|
31
31
|
|
|
32
32
|
# Set the weights array, and confirm its shape
|
|
33
|
-
self._weights:
|
|
33
|
+
self._weights: NDArrayNumeric
|
|
34
34
|
if weights is None:
|
|
35
35
|
weights = np.ones(self._length)
|
|
36
36
|
elif not isinstance(weights, np.ndarray):
|
|
37
|
-
weights = np.array(weights)
|
|
37
|
+
weights = np.array(weights, dtype=np.float64)
|
|
38
38
|
expected_shape = (self._length,)
|
|
39
39
|
if weights.shape != expected_shape:
|
|
40
40
|
raise ValueError(f'weights expected shape {expected_shape}, got {weights.shape}')
|
|
41
|
+
# if not isinstance(weights.dtype, NDArrayNumeric):
|
|
42
|
+
# raise ValueError(f'weights expected numeric dtype, got {weights.dtype}')
|
|
41
43
|
|
|
42
44
|
self._weights = weights
|
|
43
45
|
|
|
@@ -55,7 +57,7 @@ class Dataset:
|
|
|
55
57
|
return self._rvs
|
|
56
58
|
|
|
57
59
|
@property
|
|
58
|
-
def weights(self) ->
|
|
60
|
+
def weights(self) -> NDArrayNumeric:
|
|
59
61
|
"""
|
|
60
62
|
Get the instance weights.
|
|
61
63
|
The notional weight of an instance is 1.
|
|
@@ -84,7 +86,7 @@ class Dataset:
|
|
|
84
86
|
"""
|
|
85
87
|
rvs = self._rvs
|
|
86
88
|
i: int = self._rvs.index(rv)
|
|
87
|
-
self._rvs = rvs[:i] + rvs[i+1:]
|
|
89
|
+
self._rvs = rvs[:i] + rvs[i + 1:]
|
|
88
90
|
|
|
89
91
|
|
|
90
92
|
class HardDataset(Dataset):
|
|
@@ -97,6 +99,7 @@ class HardDataset(Dataset):
|
|
|
97
99
|
@staticmethod
|
|
98
100
|
def from_soft_dataset(
|
|
99
101
|
soft_dataset: SoftDataset,
|
|
102
|
+
*,
|
|
100
103
|
adjust_instance_weights: bool = True,
|
|
101
104
|
) -> HardDataset:
|
|
102
105
|
"""
|
|
@@ -124,20 +127,24 @@ class HardDataset(Dataset):
|
|
|
124
127
|
|
|
125
128
|
def __init__(
|
|
126
129
|
self,
|
|
127
|
-
data: Iterable[Tuple[RandomVariable,
|
|
128
|
-
|
|
130
|
+
data: Iterable[Tuple[RandomVariable, NDArrayStates | Sequence[int]]] = (),
|
|
131
|
+
*,
|
|
132
|
+
weights: Optional[NDArrayNumeric | Sequence[float | int]] = None,
|
|
129
133
|
length: Optional[int] = None,
|
|
130
134
|
):
|
|
131
135
|
"""
|
|
132
136
|
Create a hard dataset.
|
|
133
137
|
|
|
138
|
+
When `weights` is a numpy array, then the dataset will directly reference the given array.
|
|
139
|
+
When `data` contains a numpy array, then the dataset will directly reference the given array.
|
|
140
|
+
|
|
134
141
|
Args:
|
|
135
142
|
data: optional iterable of (random variable, state idxs), passed
|
|
136
143
|
to `self.add_rv_from_state_idxs`.
|
|
137
144
|
weights: optional array of instance weights.
|
|
138
145
|
length: optional length of the dataset, if omitted, the length is inferred.
|
|
139
146
|
"""
|
|
140
|
-
self._data: Dict[RandomVariable,
|
|
147
|
+
self._data: Dict[RandomVariable, NDArrayStates] = {}
|
|
141
148
|
|
|
142
149
|
# Initialise super by either weights, length or first data item.
|
|
143
150
|
super_initialised: bool = False
|
|
@@ -154,9 +161,9 @@ class HardDataset(Dataset):
|
|
|
154
161
|
if not super_initialised:
|
|
155
162
|
super().__init__(weights, 0)
|
|
156
163
|
|
|
157
|
-
def
|
|
164
|
+
def state_idxs(self, rv: RandomVariable) -> NDArrayStates:
|
|
158
165
|
"""
|
|
159
|
-
Get the state
|
|
166
|
+
Get the state indexes for one random variable.
|
|
160
167
|
The index into the returned array is the instance index.
|
|
161
168
|
|
|
162
169
|
Returns:
|
|
@@ -167,7 +174,7 @@ class HardDataset(Dataset):
|
|
|
167
174
|
"""
|
|
168
175
|
return self._data[rv]
|
|
169
176
|
|
|
170
|
-
def add_rv(self, rv: RandomVariable) ->
|
|
177
|
+
def add_rv(self, rv: RandomVariable) -> NDArrayStates:
|
|
171
178
|
"""
|
|
172
179
|
Add a random variable to the dataset, allocating and returning
|
|
173
180
|
the state indices for the random variable.
|
|
@@ -198,11 +205,11 @@ class HardDataset(Dataset):
|
|
|
198
205
|
del self._data[rv]
|
|
199
206
|
self._remove_rv(rv)
|
|
200
207
|
|
|
201
|
-
def add_rv_from_state_idxs(self, rv: RandomVariable, state_idxs:
|
|
208
|
+
def add_rv_from_state_idxs(self, rv: RandomVariable, state_idxs: NDArrayStates | Sequence[int]) -> NDArrayStates:
|
|
202
209
|
"""
|
|
203
210
|
Add a random variable to the dataset.
|
|
204
211
|
|
|
205
|
-
|
|
212
|
+
When `state_idxs` is a numpy array, then the dataset will directly reference the given array.
|
|
206
213
|
|
|
207
214
|
Args:
|
|
208
215
|
rv: The random variable to add.
|
|
@@ -234,7 +241,7 @@ class HardDataset(Dataset):
|
|
|
234
241
|
self._add_rv(rv)
|
|
235
242
|
return rv_data
|
|
236
243
|
|
|
237
|
-
def add_rv_from_states(self, rv: RandomVariable, states: Sequence[State]) ->
|
|
244
|
+
def add_rv_from_states(self, rv: RandomVariable, states: Sequence[State]) -> NDArrayStates:
|
|
238
245
|
"""
|
|
239
246
|
Add a random variable to the dataset.
|
|
240
247
|
|
|
@@ -266,9 +273,9 @@ class HardDataset(Dataset):
|
|
|
266
273
|
def add_rv_from_state_weights(
|
|
267
274
|
self,
|
|
268
275
|
rv: RandomVariable,
|
|
269
|
-
state_weights:
|
|
276
|
+
state_weights: NDArrayNumeric,
|
|
270
277
|
adjust_instance_weights: bool = True,
|
|
271
|
-
) ->
|
|
278
|
+
) -> NDArrayStates:
|
|
272
279
|
"""
|
|
273
280
|
Add a random variable to the dataset.
|
|
274
281
|
|
|
@@ -306,7 +313,7 @@ class HardDataset(Dataset):
|
|
|
306
313
|
)
|
|
307
314
|
|
|
308
315
|
if adjust_instance_weights:
|
|
309
|
-
row:
|
|
316
|
+
row: NDArrayNumeric
|
|
310
317
|
for i, row in enumerate(state_weights):
|
|
311
318
|
self._weights[i] *= row.sum()
|
|
312
319
|
|
|
@@ -320,13 +327,13 @@ class HardDataset(Dataset):
|
|
|
320
327
|
Args:
|
|
321
328
|
show_rvs: If `True`, the random variables are dumped.
|
|
322
329
|
show_weights: If `True`, the instance weights are dumped.
|
|
323
|
-
as_states: If `True`, the states are dumped
|
|
330
|
+
as_states: If `True`, the states are dumped instead of just state indexes.
|
|
324
331
|
"""
|
|
325
332
|
if show_rvs:
|
|
326
333
|
rvs = ', '.join(str(rv) for rv in self.rvs)
|
|
327
334
|
print(f'rvs: [{rvs}]')
|
|
328
335
|
print(f'instances ({len(self)}, with total weight {self.total_weight()}):')
|
|
329
|
-
cols = [self.
|
|
336
|
+
cols = [self.state_idxs(rv) for rv in self.rvs]
|
|
330
337
|
for instance, weight in zip(zip(*cols), self.weights):
|
|
331
338
|
if as_states:
|
|
332
339
|
instance_str = ', '.join(repr(rv.states[idx]) for idx, rv in zip(instance, self.rvs))
|
|
@@ -367,25 +374,29 @@ class SoftDataset(Dataset):
|
|
|
367
374
|
"""
|
|
368
375
|
dataset = SoftDataset(weights=hard_dataset.weights.copy())
|
|
369
376
|
for rv in hard_dataset.rvs:
|
|
370
|
-
dataset.add_rv_from_state_idxs(rv, hard_dataset.
|
|
377
|
+
dataset.add_rv_from_state_idxs(rv, hard_dataset.state_idxs(rv))
|
|
371
378
|
return dataset
|
|
372
379
|
|
|
373
380
|
def __init__(
|
|
374
381
|
self,
|
|
375
|
-
data: Iterable[Tuple[RandomVariable,
|
|
376
|
-
|
|
382
|
+
data: Iterable[Tuple[RandomVariable, NDArrayNumeric | Sequence[Sequence[float]]]] = (),
|
|
383
|
+
*,
|
|
384
|
+
weights: Optional[NDArrayNumeric | Sequence[float | int]] = None,
|
|
377
385
|
length: Optional[int] = None,
|
|
378
386
|
):
|
|
379
387
|
"""
|
|
380
388
|
Create a soft dataset.
|
|
381
389
|
|
|
390
|
+
When `weights` is a numpy array, then the dataset will directly reference the given array.
|
|
391
|
+
When `data` contains a numpy array, then the dataset will directly reference the given array.
|
|
392
|
+
|
|
382
393
|
Args:
|
|
383
394
|
data: optional iterable of (random variable, state weights), passed
|
|
384
395
|
to `self.add_rv_from_state_weights`.
|
|
385
396
|
weights: optional array of instance weights.
|
|
386
397
|
length: optional length of the dataset, if omitted, the length is inferred.
|
|
387
398
|
"""
|
|
388
|
-
self._data: Dict[RandomVariable,
|
|
399
|
+
self._data: Dict[RandomVariable, NDArrayNumeric] = {}
|
|
389
400
|
|
|
390
401
|
# Initialise super by either weights, length or first data item.
|
|
391
402
|
super_initialised: bool = False
|
|
@@ -423,10 +434,10 @@ class SoftDataset(Dataset):
|
|
|
423
434
|
RuntimeError: if `check_negative_instance` is true and a negative
|
|
424
435
|
instance weight is encountered.
|
|
425
436
|
"""
|
|
426
|
-
state_weights:
|
|
437
|
+
state_weights: NDArrayNumeric
|
|
427
438
|
i: int
|
|
428
439
|
|
|
429
|
-
weights:
|
|
440
|
+
weights: NDArrayNumeric = self.weights
|
|
430
441
|
for i in range(self._length):
|
|
431
442
|
for state_weights in self._data.values():
|
|
432
443
|
weight_sum = state_weights[i].sum()
|
|
@@ -442,7 +453,7 @@ class SoftDataset(Dataset):
|
|
|
442
453
|
elif check_negative_instance and instance_weight < 0:
|
|
443
454
|
raise RuntimeError(f'negative instance weight: {i}')
|
|
444
455
|
|
|
445
|
-
def state_weights(self, rv: RandomVariable) ->
|
|
456
|
+
def state_weights(self, rv: RandomVariable) -> NDArrayNumeric:
|
|
446
457
|
"""
|
|
447
458
|
Get the state weights for one random variable.
|
|
448
459
|
The first index into the returned array is the instance index.
|
|
@@ -456,7 +467,7 @@ class SoftDataset(Dataset):
|
|
|
456
467
|
"""
|
|
457
468
|
return self._data[rv]
|
|
458
469
|
|
|
459
|
-
def add_rv(self, rv: RandomVariable) ->
|
|
470
|
+
def add_rv(self, rv: RandomVariable) -> NDArrayNumeric:
|
|
460
471
|
"""
|
|
461
472
|
Add a random variable to the dataset, allocating and returning
|
|
462
473
|
the state indices for the random variable.
|
|
@@ -487,11 +498,15 @@ class SoftDataset(Dataset):
|
|
|
487
498
|
del self._data[rv]
|
|
488
499
|
self._remove_rv(rv)
|
|
489
500
|
|
|
490
|
-
def add_rv_from_state_weights(
|
|
501
|
+
def add_rv_from_state_weights(
|
|
502
|
+
self,
|
|
503
|
+
rv: RandomVariable,
|
|
504
|
+
state_weights: NDArrayNumeric | Sequence[Sequence[float]],
|
|
505
|
+
) -> NDArrayNumeric:
|
|
491
506
|
"""
|
|
492
507
|
Add a random variable to the dataset.
|
|
493
508
|
|
|
494
|
-
|
|
509
|
+
When `state_weights` is a numpy array, then the dataset will directly reference the given array.
|
|
495
510
|
|
|
496
511
|
Args:
|
|
497
512
|
rv: The random variable to add.
|
|
@@ -503,6 +518,9 @@ class SoftDataset(Dataset):
|
|
|
503
518
|
if rv in self._data.keys():
|
|
504
519
|
raise ValueError(f'data for {rv} already exists in the dataset')
|
|
505
520
|
|
|
521
|
+
if not isinstance(state_weights, np.ndarray):
|
|
522
|
+
state_weights = np.array(state_weights, dtype=np.float64)
|
|
523
|
+
|
|
506
524
|
expected_shape = (self._length, len(rv))
|
|
507
525
|
if state_weights.shape == expected_shape:
|
|
508
526
|
rv_data = state_weights
|
|
@@ -513,7 +531,7 @@ class SoftDataset(Dataset):
|
|
|
513
531
|
self._add_rv(rv)
|
|
514
532
|
return rv_data
|
|
515
533
|
|
|
516
|
-
def add_rv_from_state_idxs(self, rv: RandomVariable, state_idxs:
|
|
534
|
+
def add_rv_from_state_idxs(self, rv: RandomVariable, state_idxs: NDArrayStates | Sequence[int]) -> NDArrayNumeric:
|
|
517
535
|
"""
|
|
518
536
|
Add a random variable to the dataset.
|
|
519
537
|
|
|
@@ -533,7 +551,7 @@ class SoftDataset(Dataset):
|
|
|
533
551
|
|
|
534
552
|
return self.add_rv_from_state_weights(rv, rv_data)
|
|
535
553
|
|
|
536
|
-
def add_rv_from_states(self, rv: RandomVariable, states: Sequence[State]) ->
|
|
554
|
+
def add_rv_from_states(self, rv: RandomVariable, states: Sequence[State]) -> NDArrayNumeric:
|
|
537
555
|
"""
|
|
538
556
|
Add a random variable to the dataset.
|
|
539
557
|
|
|
@@ -558,7 +576,6 @@ class SoftDataset(Dataset):
|
|
|
558
576
|
def dump(self, *, show_rvs: bool = True, show_weights: bool = True) -> None:
|
|
559
577
|
"""
|
|
560
578
|
Dump the dataset in a human-readable format.
|
|
561
|
-
If as_states is true, then instance states are dumped instead of just state indexes.
|
|
562
579
|
|
|
563
580
|
Args:
|
|
564
581
|
show_rvs: If `True`, the random variables are dumped.
|