Skip to content

Commit 82553a3

Browse files
authored
Merge pull request #114 from reds-heig/doc_update_ripser_cpp
Doc update ripser.py
2 parents f784e1f + fc68a77 commit 82553a3

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
steps:
5353
- uses: actions/checkout@v2
54-
- uses: conda-incubator/setup-miniconda@v1
54+
- uses: conda-incubator/setup-miniconda@v2
5555
with:
5656
auto-update-conda: true
5757
python-version: ${{ matrix.python-version }}
@@ -76,7 +76,7 @@ jobs:
7676

7777
steps:
7878
- uses: actions/checkout@v2
79-
- uses: conda-incubator/setup-miniconda@v1
79+
- uses: conda-incubator/setup-miniconda@v2
8080
with:
8181
auto-update-conda: true
8282
python-version: ${{ matrix.python-version }}

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ pip install ripser
5555

5656
If you are having trouble installing, please let us know!
5757

58+
## Optional dependency
59+
60+
Ripser.py when compiled from source can have a *steroid*<sup>1</sup> shot by replacing the standard `unordered_map` from the STL by one of the fastest implementation available: [robin_hood](https://github.com/martinus/robin-hood-hashing). Benchmarking of Ripser.py using the `robin_hood` implementation showed speed-ups up to **30%**.
61+
62+
To be able to use `robin_hood` instead of STL, you only need to clone the repository containing the implementation:
63+
64+
```
65+
# Run this command at the root of the project
66+
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
67+
```
68+
69+
<sup>1</sup> The Python package is already compiled with `robin_hood` by default.
5870

5971
## Usage
6072

docs/index.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,49 @@ We also supply a Scikit-learn transformer style object if you would prefer to us
6767
.. image:: https://i.imgur.com/WmQPYnn.png
6868

6969

70+
Source Compilation
71+
---------------------
72+
73+
In order to compile, you'll first need to do:
74+
75+
.. code:: bash
76+
77+
git clone https://github.com/scikit-tda/ripser.py
78+
cd ripser.py
79+
pip install -e .
80+
81+
You'll then be able to use Ripser.py as in the previous examples but compiled directly from sources.
82+
In order to obtain the best experience in performances when compiling from sources, you'll need an additional library, robin_hood_hashmap. To be able to use compile with this library enable, do:
83+
84+
.. code:: bash
85+
86+
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
87+
88+
The following table shows a comparison of performances with and without robin_hood_hashmap:
89+
90+
+------------+--------+-------------+-------+---------+--------------+------------------+
91+
| Dataset | size | threshold | dim | coeff | normal [s] | robin_hood [s] |
92+
+============+========+=============+=======+=========+==============+==================+
93+
| sphere3 | 192 | | 2 | 2 | 1.5 | 1.2 |
94+
+------------+--------+-------------+-------+---------+--------------+------------------+
95+
| dragon | 2000 | | 1 | 2 | 2.9 | 2.5 |
96+
+------------+--------+-------------+-------+---------+--------------+------------------+
97+
| o3 | 1024 | 1.8 | 3 | 2 | 2.9 | 2.2 |
98+
+------------+--------+-------------+-------+---------+--------------+------------------+
99+
| random16 | 50 | | 7 | 2 | 8.4 | 6.0 |
100+
+------------+--------+-------------+-------+---------+--------------+------------------+
101+
| fractal | 512 | | 2 | 2 | 17.7 | 14 |
102+
+------------+--------+-------------+-------+---------+--------------+------------------+
103+
| o3 | 4096 | 1.4 | 3 | 2 | 68.6 | 53.4 |
104+
+------------+--------+-------------+-------+---------+--------------+------------------+
105+
70106
Contributions
71107
----------------
108+
72109
We welcome contributions of all shapes and sizes. There are lots of opportunities for potential projects, so please get in touch if you would like to help out. Everything from an implementation of your favorite distance, notebooks, examples, and documentation are all equally valuable so please don’t feel you can’t contribute.
73110

74111
To contribute please fork the project make your changes and submit a pull request. We will do our best to work through any issues with you and get your code merged into the main branch.
75112

76-
77113
Citing
78114
----------
79115

0 commit comments

Comments
 (0)