multipers 1.1.3__tar.gz → 1.2.1__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 multipers might be problematic. Click here for more details.
- {multipers-1.1.3/multipers.egg-info → multipers-1.2.1}/PKG-INFO +1 -1
- {multipers-1.1.3 → multipers-1.2.1}/README.md +27 -25
- multipers-1.2.1/multipers/__init__.py +12 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/_signed_measure_meta.py +65 -22
- multipers-1.2.1/multipers/_slicer_meta.py +103 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/distances.py +2 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/euler_characteristic.cpp +2517 -3216
- {multipers-1.1.3 → multipers-1.2.1}/multipers/euler_characteristic.pyx +9 -14
- {multipers-1.1.3 → multipers-1.2.1}/multipers/function_rips.cpp +687 -618
- {multipers-1.1.3 → multipers-1.2.1}/multipers/function_rips.pyx +3 -1
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/Persistence_slices_interface.h +15 -4
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_multi.h +25 -14
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/truc.h +32 -2
- {multipers-1.1.3 → multipers-1.2.1}/multipers/hilbert_function.cpp +2437 -1948
- {multipers-1.1.3 → multipers-1.2.1}/multipers/hilbert_function.pyx +34 -18
- multipers-1.2.1/multipers/io.cpp +24076 -0
- multipers-1.2.1/multipers/io.pyx +396 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/convolutions.py +13 -19
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/mma.py +3 -5
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/signed_measures.py +20 -34
- {multipers-1.1.3 → multipers-1.2.1}/multipers/mma_structures.cpp +23 -20
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/approximation.h +1 -1
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/format_python-cpp.h +2 -2
- multipers-1.2.1/multipers/multiparameter_module_approximation/utilities.h +295 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation.cpp +2589 -6488
- multipers-1.2.1/multipers/multiparameter_module_approximation.pyx +201 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/point_measure_integration.cpp +3826 -2037
- multipers-1.2.1/multipers/point_measure_integration.pyx +76 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/rank_invariant.cpp +54 -53
- {multipers-1.1.3 → multipers-1.2.1}/multipers/simplex_tree_multi.cpp +8210 -6458
- {multipers-1.1.3 → multipers-1.2.1}/multipers/simplex_tree_multi.pxd +1 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/simplex_tree_multi.pyx +48 -9
- {multipers-1.1.3 → multipers-1.2.1}/multipers/slicer.cpp +23039 -8300
- multipers-1.2.1/multipers/slicer.pxd +131 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/slicer.pyx +184 -2
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/test_mma.py +1 -1
- {multipers-1.1.3 → multipers-1.2.1/multipers.egg-info}/PKG-INFO +1 -1
- {multipers-1.1.3 → multipers-1.2.1}/multipers.egg-info/SOURCES.txt +1 -0
- {multipers-1.1.3 → multipers-1.2.1}/setup.py +1 -1
- multipers-1.1.3/multipers/__init__.py +0 -5
- multipers-1.1.3/multipers/io.cpp +0 -14352
- multipers-1.1.3/multipers/io.pyx +0 -176
- multipers-1.1.3/multipers/multiparameter_module_approximation/utilities.h +0 -283
- multipers-1.1.3/multipers/multiparameter_module_approximation.pyx +0 -311
- multipers-1.1.3/multipers/point_measure_integration.pyx +0 -59
- multipers-1.1.3/multipers/slicer.pxd +0 -94
- {multipers-1.1.3 → multipers-1.2.1}/LICENSE +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/MANIFEST.in +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/_old_rank_invariant.pyx +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/MOL2.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/UCR.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/__init__.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/graphs.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/immuno_regions.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/minimal_presentation_to_st_bf.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/pytorch2simplextree.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/shape3d.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/data/synthetic.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/Simplex_tree_interface.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/Simplex_tree_multi_interface.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Bitmap_cubical_complex.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Bitmap_cubical_complex_base.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Clock.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Cubical_multi_complex_interface.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Debug_utils.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Multi_field.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Multi_field_shared.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Multi_field_small.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Multi_field_small_shared.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Z2_field.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Zp_field.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Fields/Zp_field_shared.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Flag_complex_edge_collapser.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Null_output_iterator.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Off_reader.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/base_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/base_matrix_with_column_compression.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/base_pairing.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/base_swap.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/boundary_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/chain_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/chain_pairing.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/chain_rep_cycles.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/chain_vine_swap.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/cell_types.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/chain_column_extra_properties.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/column_dimension_holder.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/heap_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/intrusive_list_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/intrusive_set_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/list_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/naive_vector_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/row_access.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/set_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/unordered_set_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/columns/vector_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/matrix_dimension_holders.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/matrix_row_access.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/overlay_id_to_position_index.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/overlay_position_to_id_index.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/ru_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/ru_pairing.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/ru_rep_cycles.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistence_matrix/ru_vine_swap.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistent_cohomology/Field_Zp.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistent_cohomology/Multi_field.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistent_cohomology/Persistent_cohomology_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Persistent_cohomology.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Point.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Points_3D_off_io.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Points_off_io.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simple_object_pool.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_iterators.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_siblings.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_star_simplex_iterators.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/hooks_simplex_base.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/indexing_tag.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/multi_filtrations/Box.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/multi_filtrations/Finitely_critical_filtrations.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/multi_filtrations/Line.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/serialization_utils.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree/simplex_tree_options.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Simplex_tree.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/Unitary_tests_utils.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/console_color.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/distance_functions.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/graph_simplicial_complex.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/persistence_matrix_options.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/random_point_generators.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/reader_utils.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/gudhi/writing_persistence_to_file.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/mma_interface_h0.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/mma_interface_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/gudhi/naive_merge_tree.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/hilbert_function.pyi +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/__init__.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/accuracies.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/invariants_with_persistable.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/kernels.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/one.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/point_clouds.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/signed_betti.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/sliced_wasserstein.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/ml/tools.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/mma_structures.pxd +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/mma_structures.pyx +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/_old_function_rips.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/_old_rank_invariant.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/euler_characteristic.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/function_rips.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/hilbert_function.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/landscapes.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/persistence_slices.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multi_parameter_rank_invariant/rank_invariant.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_edge_collapse.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/combinatory.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/debug.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/euler_curves.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/heap_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/images.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/list_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/list_column_2.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/ru_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/set_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/structure_higher_dim_barcode.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/unordered_set_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/vector_column.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/vector_matrix.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/vineyards.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation/vineyards_trajectories.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/multiparameter_module_approximation.pyi +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/pickle.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/plots.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/rank_invariant.pyx +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/simplex_tree_multi.pyi +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tensor/tensor.h +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tensor.pxd +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/test.pyx +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/old_test_rank_invariant.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/test_hilbert_function.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/test_point_clouds.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/test_python-cpp_conversion.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/test_signed_betti.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers/tests/test_simplextreemulti.py +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers.egg-info/dependency_links.txt +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/multipers.egg-info/top_level.txt +0 -0
- {multipers-1.1.3 → multipers-1.2.1}/setup.cfg +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
# Multipers
|
|
2
|
+
[](https://pepy.tech/project/multipers)
|
|
3
|
+
<br>
|
|
2
4
|
Scikit-style multiparameter persistent homology python library.
|
|
3
5
|
This librairy aims to provide easy to use and performant strategies for applied multiparameter topology.
|
|
6
|
+
A non-exhaustive list of features can be found in the **Features** section.
|
|
4
7
|
<br> Meant to be integrated in [the Gudhi library](https://gudhi.inria.fr/).
|
|
5
8
|
|
|
9
|
+
|
|
6
10
|
## Installation
|
|
7
|
-
|
|
8
|
-
Using conda
|
|
11
|
+
Some dependencies are needed, e.g., using conda
|
|
9
12
|
```sh
|
|
10
13
|
conda create -n python311
|
|
11
14
|
conda activate python311
|
|
@@ -14,7 +17,6 @@ pip install filtration-domination pykeops
|
|
|
14
17
|
```
|
|
15
18
|
Other libraries may be required for some specific functions, e.g., pytorch for to compute the rank invariant.
|
|
16
19
|
|
|
17
|
-
### Installation
|
|
18
20
|
#### Using pip (Recommended)
|
|
19
21
|
Precompiled versions, for linux and macos, are available [on PyPI](https://pypi.org/project/multipers/). Just use
|
|
20
22
|
```sh
|
|
@@ -26,47 +28,47 @@ Clone the repo, and in a terminal, in the root folder
|
|
|
26
28
|
conda install python=3.11 cxx-compiler boost tbb tbb-devel numpy matplotlib gudhi scikit-learn cython sympy tqdm cycler typing shapely -c conda-forge
|
|
27
29
|
pip install .
|
|
28
30
|
```
|
|
29
|
-
|
|
30
|
-
If the build fails (on macos) see a fix at the end of the readme.
|
|
31
|
-
Don't hesitate to fill an issue if this doesn't work out of the box; it can help future users ;-).
|
|
31
|
+
Mostly tested on *latest everything* on linux. **For macos users**, this command may fail, see a fix at the end.
|
|
32
32
|
|
|
33
33
|
## How to use
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
To get a first idea on how this library works, we provide a few tutorial notebooks, in the **tutorial** folder.
|
|
35
|
+
<br>
|
|
36
|
+
If something is not clear, or a function not covered, feel free to open an issue to ask for an example (or open a PR with a new notebook).
|
|
37
|
+
<br>
|
|
38
|
+
As the example zoo is far from covering everything, don't hesitate to submit something if you find an interesting example.
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
##
|
|
41
|
-
|
|
41
|
+
## Features, and linked projects
|
|
42
|
+
This librairy features a bunch of different functions and helpers. See below for a non-exhaustive list.
|
|
43
|
+
<br>Filled box refers to implemented or interfaced code.
|
|
42
44
|
- [x] [Multiparameter Module Approximation](https://arxiv.org/abs/2206.02026) provides the multiparameter simplicial structure, aswell as technics of approximating modules, via interval decompostion modules. It is also very useful for visualization.
|
|
43
45
|
- [x] [Stable Vectorization of Multiparameter Persistent Homology using Signed Barcodes as Measures](https://arxiv.org/abs/2306.03801) provides fast representations of multiparameter persistence modules, by using their signed barcodes decompositions, and encoding it into signed measures. Implemented decompositions : Euler surfaces, Hilbert function, rank invariant (i.e. rectangles). It also provides representation technics for Machine Learning, i.e., Sliced Wasserstein kernels, Vectorizations.
|
|
44
46
|
- [x] [A Framework for Fast and Stable Representations of Multiparameter Persistent Homology Decompositions](https://arxiv.org/abs/2306.11170) Provides a vectorization framework for interval decomposable modules, for Machine Learning. Currently implemented as an extension of MMA.
|
|
45
|
-
- [x] [
|
|
47
|
+
- [x] [Multiparameter Persistence Landscapes](https://jmlr.org/papers/v21/19-054.html) A vectoriazation technic for multiparameter persistence modules.
|
|
48
|
+
- [x] [Filtration-Domination in Bifiltered Graphs](https://doi.org/10.1137/1.9781611977561.ch3) Allows for 2-parameter edge collapses for 1-critical clique complexes. **Very useful** to speed up, e.g., Rips-Codensity bifiltrations.
|
|
49
|
+
- [x] [Chunk Reduction for Multi-Parameter Persistent Homology](https://doi.org/10.4230/LIPIcs.SoCG.2019.37) Multi-filtration preprocessing algorithm.
|
|
46
50
|
- [x] [Computing Minimal Presentations and Bigraded Betti Numbers of 2-Parameter Persistent Homology](https://arxiv.org/abs/1902.05708) Minimal presentation of multiparameter persistence modules, using [mpfree](https://bitbucket.org/mkerber/mpfree/src/master/). Hilbert Decomposition Signed Measures, and MMA decompositions can be computed using the mpfree backend.
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [ ] [
|
|
50
|
-
- [
|
|
51
|
+
- [x] [Delaunay Bifiltrations of Functions on Point Clouds](https://arxiv.org/abs/2310.15902) Provides an alternative to function rips bifiltrations, using Delaunay complexes. Very good alternative to Rips-Density like bi-filtrations.
|
|
52
|
+
- [x] [Rivet](https://github.com/rivetTDA/rivet) Interactive two parameter persistence
|
|
53
|
+
- [ ] [Backend only] [Projected distances for multi-parameter persistence modules](https://arxiv.org/abs/2206.08818) Provides a strategy to estimate the convolution distance between multiparameter persistence module using projected barcodes. Implementation is a WIP.
|
|
54
|
+
- [ ] [Partial, and experimental] [Efficient Two-Parameter Persistence Computation via Cohomology](https://doi.org/10.4230/LIPIcs.SoCG.2023.15) Minimal presentations for 2-parameter persistence algorithm.
|
|
51
55
|
|
|
56
|
+
If I missed something, or you want to add something, feel free to open an issue.
|
|
52
57
|
|
|
53
58
|
## Authors
|
|
54
|
-
[David Loiseaux](https://www-sop.inria.fr/members/David.Loiseaux/index.html)
|
|
59
|
+
[David Loiseaux](https://www-sop.inria.fr/members/David.Loiseaux/index.html),<br>
|
|
60
|
+
[Hannah Schreiber](https://github.com/hschreiber) (Persistence backend code),<br>
|
|
55
61
|
[Luis Scoccola](https://luisscoccola.com/)
|
|
56
|
-
(Möbius inversion in python, degree-rips using [persistable](https://github.com/LuisScoccola/persistable) and [RIVET](https://github.com/rivetTDA/rivet/))
|
|
57
|
-
[Mathieu Carrière](https://www-sop.inria.fr/members/Mathieu.Carriere/) (Sliced Wasserstein)
|
|
62
|
+
(Möbius inversion in python, degree-rips using [persistable](https://github.com/LuisScoccola/persistable) and [RIVET](https://github.com/rivetTDA/rivet/)),<br>
|
|
63
|
+
[Mathieu Carrière](https://www-sop.inria.fr/members/Mathieu.Carriere/) (Sliced Wasserstein)<br>
|
|
58
64
|
|
|
59
65
|
## Contributions
|
|
60
|
-
Hannah Schreiber
|
|
61
66
|
|
|
62
67
|
Feel free to contribute, report a bug on a pipeline, or ask for documentation by opening an issue.<br>
|
|
63
|
-
**Any contribution is welcome**.
|
|
64
|
-
|
|
65
|
-
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
## For mac users
|
|
69
|
-
Due to
|
|
71
|
+
Due to apple's clang compiler, one may have to disable a compilator optimization to compile `multipers`: in the `setup.py` file, add the
|
|
70
72
|
```bash
|
|
71
73
|
-fno-aligned-new
|
|
72
74
|
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Doc
|
|
2
|
+
import multipers.simplex_tree_multi
|
|
3
|
+
import multipers.multiparameter_module_approximation
|
|
4
|
+
import multipers.slicer
|
|
5
|
+
import multipers.io
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Shortcuts
|
|
9
|
+
from multipers.simplex_tree_multi import SimplexTreeMulti
|
|
10
|
+
from multipers._signed_measure_meta import signed_measure
|
|
11
|
+
from multipers._slicer_meta import Slicer
|
|
12
|
+
from multipers.multiparameter_module_approximation import module_approximation
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
from multipers.plots import plot_signed_measures
|
|
1
2
|
from multipers.simplex_tree_multi import SimplexTreeMulti # Typing hack
|
|
2
|
-
from typing import Optional
|
|
3
|
+
from typing import Optional, Union
|
|
3
4
|
import numpy as np
|
|
4
5
|
from multipers.simplex_tree_multi import _available_strategies
|
|
5
6
|
|
|
7
|
+
from multipers.slicer import (
|
|
8
|
+
Slicer,
|
|
9
|
+
SlicerClement,
|
|
10
|
+
SlicerVineGraph,
|
|
11
|
+
SlicerVineSimplicial,
|
|
12
|
+
)
|
|
13
|
+
|
|
6
14
|
|
|
7
15
|
def signed_measure(
|
|
8
|
-
simplextree:
|
|
16
|
+
simplextree: Union[
|
|
17
|
+
SimplexTreeMulti, Slicer, SlicerClement, SlicerVineGraph, SlicerVineSimplicial
|
|
18
|
+
],
|
|
9
19
|
degree: Optional[int] = None,
|
|
10
20
|
degrees=[None],
|
|
11
21
|
mass_default=None,
|
|
@@ -19,19 +29,25 @@ def signed_measure(
|
|
|
19
29
|
thread_id: str = "",
|
|
20
30
|
mpfree_path: Optional[str] = None,
|
|
21
31
|
grid_conversion: Optional[list] = None,
|
|
32
|
+
coordinate_measure: bool = False,
|
|
22
33
|
num_collapses: int = 0,
|
|
23
34
|
**infer_grid_kwargs,
|
|
24
35
|
):
|
|
25
36
|
"""
|
|
26
|
-
Computes the signed measures given by the decomposition of the hilbert
|
|
37
|
+
Computes the signed measures given by the decomposition of the hilbert
|
|
38
|
+
function or the euler characteristic.
|
|
27
39
|
|
|
28
40
|
Input
|
|
29
41
|
-----
|
|
30
|
-
- simplextree:SimplexTreeMulti, the multifiltered simplicial complex.
|
|
31
|
-
|
|
32
|
-
-
|
|
42
|
+
- simplextree:SimplexTreeMulti, the multifiltered simplicial complex.
|
|
43
|
+
Its recommended to squeeze the simplextree first.
|
|
44
|
+
- mass_default: Either None, or 'auto' or 'inf', or array-like of floats.
|
|
45
|
+
Where to put the default mass to get a zero-mass measure.
|
|
46
|
+
- degree:int|None / degrees:list[int] the degrees to compute.
|
|
47
|
+
None represents the euler characteristic.
|
|
33
48
|
- plot:bool, plots the computed measures if true.
|
|
34
|
-
- n_jobs:int, number of jobs.
|
|
49
|
+
- n_jobs:int, number of jobs.
|
|
50
|
+
Defaults to #cpu, but when doing parallel computations of signed measures, we recommend setting this to 1.
|
|
35
51
|
- verbose:bool, prints c++ logs.
|
|
36
52
|
|
|
37
53
|
Output
|
|
@@ -39,6 +55,12 @@ def signed_measure(
|
|
|
39
55
|
`[signed_measure_of_degree for degree in degrees]`
|
|
40
56
|
with `signed_measure_of_degree` of the form `(dirac location, dirac weights)`.
|
|
41
57
|
"""
|
|
58
|
+
if not isinstance(simplextree, SimplexTreeMulti):
|
|
59
|
+
return _signed_measure_from_slicer(
|
|
60
|
+
simplextree,
|
|
61
|
+
plot=plot,
|
|
62
|
+
grid_conversion=grid_conversion,
|
|
63
|
+
)
|
|
42
64
|
assert invariant is None or invariant in [
|
|
43
65
|
"hilbert",
|
|
44
66
|
"rank_invariant",
|
|
@@ -59,21 +81,24 @@ def signed_measure(
|
|
|
59
81
|
if not simplextree._is_squeezed:
|
|
60
82
|
simplextree_ = SimplexTreeMulti(simplextree)
|
|
61
83
|
if grid_conversion is None:
|
|
62
|
-
simplextree_.
|
|
84
|
+
grid_conversion = simplextree_.get_filtration_grid(
|
|
63
85
|
grid_strategy=grid_strategy,
|
|
64
|
-
coordinate_values=not (backend == "mpfree"),
|
|
65
86
|
**infer_grid_kwargs,
|
|
66
87
|
) # put a warning ?
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)
|
|
88
|
+
simplextree_.grid_squeeze(
|
|
89
|
+
grid_conversion,
|
|
90
|
+
coordinate_values=True,
|
|
91
|
+
**infer_grid_kwargs,
|
|
92
|
+
)
|
|
73
93
|
if num_collapses != 0:
|
|
74
94
|
simplextree_.collapse_edges(num_collapses)
|
|
75
95
|
else:
|
|
76
96
|
simplextree_ = simplextree
|
|
97
|
+
if grid_conversion is None:
|
|
98
|
+
grid_conversion = [np.asarray(f) for f in simplextree_.filtration_grid]
|
|
99
|
+
if coordinate_measure:
|
|
100
|
+
grid_conversion = None
|
|
101
|
+
|
|
77
102
|
if backend == "mpfree":
|
|
78
103
|
if mpfree_path is not None:
|
|
79
104
|
import multipers.io as mio
|
|
@@ -87,17 +112,11 @@ def signed_measure(
|
|
|
87
112
|
from multipers.io import minimal_presentation_from_mpfree
|
|
88
113
|
|
|
89
114
|
minimal_presentation = minimal_presentation_from_mpfree(
|
|
90
|
-
|
|
115
|
+
simplextree_,
|
|
91
116
|
True,
|
|
92
117
|
degrees[0],
|
|
93
118
|
id=thread_id,
|
|
94
119
|
)
|
|
95
|
-
if grid_conversion is not None:
|
|
96
|
-
grid_conversion = grid_conversion
|
|
97
|
-
elif simplextree._is_squeezed:
|
|
98
|
-
grid_conversion = simplextree.filtration_grid
|
|
99
|
-
else:
|
|
100
|
-
grid_conversion = None
|
|
101
120
|
sms = _signed_measure_from_scc(
|
|
102
121
|
minimal_presentation, grid_conversion=grid_conversion
|
|
103
122
|
)
|
|
@@ -122,11 +141,13 @@ def signed_measure(
|
|
|
122
141
|
mass_default.ndim == 1
|
|
123
142
|
and mass_default.shape[0] == simplextree.num_parameters
|
|
124
143
|
)
|
|
144
|
+
# assert not coordinate_measure or grid_conversion is None
|
|
125
145
|
|
|
126
146
|
if invariant in ["rank_invariant", "rank"]:
|
|
127
147
|
assert (
|
|
128
148
|
simplextree.num_parameters == 2
|
|
129
149
|
), "Rank invariant only implemented for 2-parameter modules."
|
|
150
|
+
assert not coordinate_measure, "Not implemented"
|
|
130
151
|
from multipers.rank_invariant import signed_measure as smri
|
|
131
152
|
|
|
132
153
|
sms = smri(
|
|
@@ -141,6 +162,7 @@ def signed_measure(
|
|
|
141
162
|
"euler",
|
|
142
163
|
"euler_characteristic",
|
|
143
164
|
], "Provide a degree to compute hilbert function."
|
|
165
|
+
# assert not coordinate_measure, "Not implemented"
|
|
144
166
|
from multipers.euler_characteristic import euler_signed_measure
|
|
145
167
|
|
|
146
168
|
sms = [
|
|
@@ -191,3 +213,24 @@ def _signed_measure_from_scc(minimal_presentation, grid_conversion=None):
|
|
|
191
213
|
else:
|
|
192
214
|
sm = [(pts, weights)]
|
|
193
215
|
return sm
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def _signed_measure_from_slicer(
|
|
219
|
+
slicer: Union[Slicer, SlicerClement, SlicerVineGraph, SlicerVineSimplicial],
|
|
220
|
+
plot: bool = False,
|
|
221
|
+
grid_conversion=None,
|
|
222
|
+
):
|
|
223
|
+
pts = slicer.get_filtrations()
|
|
224
|
+
dims = slicer.get_dimensions()
|
|
225
|
+
weights = 1 - 2 * ((1 + dims) % 2)
|
|
226
|
+
if grid_conversion is not None:
|
|
227
|
+
pts = np.asarray(pts, dtype=int)
|
|
228
|
+
coords = np.empty(shape=pts.shape, dtype=float)
|
|
229
|
+
for i in range(coords.shape[1]):
|
|
230
|
+
coords[:, i] = np.asarray(grid_conversion[i])[pts[:, i]]
|
|
231
|
+
sm = [(coords, weights)]
|
|
232
|
+
else:
|
|
233
|
+
sm = [(pts, weights)]
|
|
234
|
+
if plot:
|
|
235
|
+
plot_signed_measures(sm)
|
|
236
|
+
return sm
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from typing import Literal, Optional
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import multipers.slicer as mps
|
|
5
|
+
import multipers.simplex_tree_multi
|
|
6
|
+
from multipers.simplex_tree_multi import SimplexTreeMulti
|
|
7
|
+
import multipers.io as mio
|
|
8
|
+
import numpy as np
|
|
9
|
+
from copy import deepcopy
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _blocks2boundary_dimension_grades(
|
|
13
|
+
blocks, filtration_type=np.float32, num_parameters: int = -1
|
|
14
|
+
):
|
|
15
|
+
"""
|
|
16
|
+
Turns blocks, aka scc, into the input of non-simplicial slicers.
|
|
17
|
+
"""
|
|
18
|
+
if num_parameters < 0:
|
|
19
|
+
for b in blocks:
|
|
20
|
+
if len(b[0]) > 0:
|
|
21
|
+
num_parameters = np.asarray(b[0]).shape[1]
|
|
22
|
+
break
|
|
23
|
+
if num_parameters < 0:
|
|
24
|
+
# empty presentation
|
|
25
|
+
# return [], [], np.empty(0, dtype=filtration_type)
|
|
26
|
+
raise ValueError("Empty Filtration")
|
|
27
|
+
rblocks = deepcopy(blocks)
|
|
28
|
+
rblocks.reverse()
|
|
29
|
+
block_sizes = [len(b[0]) for b in rblocks]
|
|
30
|
+
S = np.cumsum([0, 0] + block_sizes)
|
|
31
|
+
multifiltration = np.concatenate(
|
|
32
|
+
tuple(
|
|
33
|
+
b[0] if len(b[0]) > 0 else np.empty((0, num_parameters)) for b in rblocks
|
|
34
|
+
),
|
|
35
|
+
dtype=filtration_type,
|
|
36
|
+
)
|
|
37
|
+
boundary = tuple(x + S[i] for i, b in enumerate(rblocks) for x in b[1])
|
|
38
|
+
dimensions = np.fromiter(
|
|
39
|
+
(i for i, b in enumerate(rblocks) for _ in range(len(b[0]))), dtype=int
|
|
40
|
+
)
|
|
41
|
+
return boundary, dimensions, multifiltration
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def Slicer(
|
|
45
|
+
st: SimplexTreeMulti | list | str,
|
|
46
|
+
backend: Literal["matrix", "clement", "graph"] = "matrix",
|
|
47
|
+
vineyard: bool = True,
|
|
48
|
+
):
|
|
49
|
+
"""
|
|
50
|
+
Given a simplextree or blocks (a.k.a scc for python),
|
|
51
|
+
returns a structure that can compute persistence on line (or more)
|
|
52
|
+
slices, eventually vineyard update, etc.
|
|
53
|
+
|
|
54
|
+
This can be used to compute interval-decomposable module approximations
|
|
55
|
+
or signed measures, using, e.g.
|
|
56
|
+
- `multipers.module_approximation(this, *args)`
|
|
57
|
+
- `multipers.signed_measure(this, *args)`
|
|
58
|
+
|
|
59
|
+
Note : it is recommended and sometime required to apply
|
|
60
|
+
a minimal presentation before computing these functions !
|
|
61
|
+
`mp.slicer.minimal_presentation(slicer, *args, **kwargs)`
|
|
62
|
+
|
|
63
|
+
st : SimplexTreeMulti or scc-like blocks
|
|
64
|
+
backend: slicer backend;
|
|
65
|
+
vineyard: vineyard capable (may slow down computations if true)
|
|
66
|
+
"""
|
|
67
|
+
if isinstance(st, SimplexTreeMulti):
|
|
68
|
+
if vineyard:
|
|
69
|
+
if backend == "matrix":
|
|
70
|
+
return mps.SlicerVineSimplicial(st)
|
|
71
|
+
if backend == "clement":
|
|
72
|
+
raise ValueError("This one takes a minpres")
|
|
73
|
+
if backend == "graph":
|
|
74
|
+
return mps.SlicerVineGraph(st)
|
|
75
|
+
raise ValueError(f"Inimplemented backend {backend}.")
|
|
76
|
+
if backend == "matrix":
|
|
77
|
+
return mps.SlicerNoVineSimplicial(st)
|
|
78
|
+
if backend == "clement":
|
|
79
|
+
raise ValueError("Clement is Vineyard")
|
|
80
|
+
if backend == "graph":
|
|
81
|
+
raise ValueError("Graph is Vineyard")
|
|
82
|
+
if backend == "graph":
|
|
83
|
+
raise ValueError("Graph is simplicial, incompatible with minpres")
|
|
84
|
+
if isinstance(st, SimplexTreeMulti):
|
|
85
|
+
blocks = mio.minimal_presentation_from_mpfree(st)
|
|
86
|
+
elif isinstance(st, str):
|
|
87
|
+
blocks = mio.scc_parser(st)
|
|
88
|
+
else:
|
|
89
|
+
blocks = st
|
|
90
|
+
|
|
91
|
+
boundary, dimensions, multifiltrations = _blocks2boundary_dimension_grades(blocks)
|
|
92
|
+
if vineyard:
|
|
93
|
+
if backend == "matrix":
|
|
94
|
+
return mps.Slicer(boundary, dimensions, multifiltrations)
|
|
95
|
+
|
|
96
|
+
if backend == "clement":
|
|
97
|
+
return mps.SlicerClement(boundary, dimensions, multifiltrations)
|
|
98
|
+
if backend == "matrix":
|
|
99
|
+
return mps.SlicerNoVine(boundary, dimensions, multifiltrations)
|
|
100
|
+
if backend == "clement":
|
|
101
|
+
raise ValueError("Clement is vineyard")
|
|
102
|
+
|
|
103
|
+
raise ValueError(f"Unimplemented combo : f{backend=}, f{vineyard=}")
|
|
@@ -51,6 +51,8 @@ def sm_distance(sm1, sm2, reg=0, reg_m=0, numItermax=10000, p=1):
|
|
|
51
51
|
empty_tensor = np.array([]) # uniform weights
|
|
52
52
|
elif isinstance(x, torch.Tensor):
|
|
53
53
|
empty_tensor = torch.tensor([]) # uniform weights
|
|
54
|
+
else:
|
|
55
|
+
raise ValueError("Unimplemented backend.")
|
|
54
56
|
|
|
55
57
|
if reg == 0:
|
|
56
58
|
return ot.lp.emd2(empty_tensor, empty_tensor, M=loss) * len(x)
|