|
| 1 | +DPPy: Sampling Determinantal Point Processes with Python |
| 2 | +======================================================== |
| 3 | + |
| 4 | +|Documentation Status| |Build Status| |
| 5 | + |
| 6 | + *"Anything that can go wrong, will go wrong"*. − `Murphy's |
| 7 | + Law <http://phdcomics.com/comics/archive.php?comicid=1867>`__ |
| 8 | + |
| 9 | +Introduction |
| 10 | +------------ |
| 11 | + |
| 12 | +Determinantal point processes (DPPs) are specific probability |
| 13 | +distributions over clouds of points that have been popular as models or |
| 14 | +computational tools across physics, probability, statistics, and more |
| 15 | +recently of booming interest in machine learning. Sampling from DPPs is |
| 16 | +a nontrivial matter, and many approaches have been proposed. DPPy is a |
| 17 | +`Python <https://www.python.org/>`__ library that puts together all |
| 18 | +exact and approximate sampling algorithms for DPPs. |
| 19 | + |
| 20 | +Requirements |
| 21 | +------------ |
| 22 | + |
| 23 | +DPPy works with `Python 3.4+ <http://docs.python.org/3/>`__ |
| 24 | + |
| 25 | +Dependencies |
| 26 | +~~~~~~~~~~~~ |
| 27 | + |
| 28 | +- `NumPy <http://www.numpy.org>`__ |
| 29 | +- `SciPy <http://www.scipy.org/>`__ |
| 30 | +- `Matplotlib <http://matplotlib.org/>`__ |
| 31 | +- `Networkx <http://networkx.github.io/>`__ to play with `uniform |
| 32 | + spanning |
| 33 | + trees <https://dppy.readthedocs.io/en/latest/exotic_dpps/index.html#uniform-spanning-trees>`__ |
| 34 | +- `CVXOPT <http://cvxopt.org>`__ to use the ``zono_sampling`` MCMC |
| 35 | + sampler for finite DPPs. **CVXOPT itself requires** |
| 36 | + `GCC <http://gcc.gnu.org>`__, |
| 37 | + |
| 38 | + - On MAC it comes with |
| 39 | + `Xcode <https://developer.apple.com/xcode/>`__ |
| 40 | + - On UNIX, use your package manager (``apt``, ``yum`` etc) |
| 41 | + |
| 42 | + .. code:: bash |
| 43 | +
|
| 44 | + sudo apt install -qq gcc g++ |
| 45 | +
|
| 46 | +Installation |
| 47 | +------------ |
| 48 | + |
| 49 | +1. If you have a GitHub account |
| 50 | + |
| 51 | + - Please consider forking DPPy |
| 52 | + - Use git to clone your copy of the repo |
| 53 | + |
| 54 | + .. code:: bash |
| 55 | +
|
| 56 | + cd <directory_of_your_choice> |
| 57 | + git clone https://github.com/<username>/DPPy.git |
| 58 | +
|
| 59 | +2. If you only use git, clone this repository |
| 60 | + |
| 61 | + .. code:: bash |
| 62 | +
|
| 63 | + cd <directory_of_your_choice> |
| 64 | + git clone https://github.com/guilgautier/DPPy.git |
| 65 | +
|
| 66 | +3. Otherwise simply dowload the project |
| 67 | + |
| 68 | +Finally, in any case, install the project |
| 69 | + |
| 70 | +.. code:: bash |
| 71 | +
|
| 72 | + cd DPPy |
| 73 | + pip install . |
| 74 | +
|
| 75 | +Tutorial in `a Jupyter notebook <https://www.Jupyter.org/>`__ |
| 76 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 77 | + |
| 78 | +You can read and work on this interactive tutorial, directly from your |
| 79 | +web browser, without having to download or install Python or anything. |
| 80 | +Just click, wait a little bit, and play with the notebook! |
| 81 | + |
| 82 | +- `Tutorial for DPPy (Tuto\_DPPy) <https://github.com/guilgautier/DPPy/blob/master/notebooks/Tuto_DPPy.ipynb>`__: |Google Colab| |
| 83 | + |
| 84 | +Contribute to the documentation |
| 85 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 86 | + |
| 87 | +The |
| 88 | +`documentation <http://dppy.readthedocs.io/>`__ |
| 89 | +is generated locally with |
| 90 | +`Sphinx <http://www.sphinx-doc.org/en/master/>`__ and then built online |
| 91 | +by `ReadTheDocs <https://readthedocs.org/projects/dppy/>`__. |
| 92 | + |
| 93 | +If you wish to contribute to the documentation or just play with it |
| 94 | +locally, you can: |
| 95 | + |
| 96 | +- Install Sphinx |
| 97 | + |
| 98 | + .. code:: bash |
| 99 | +
|
| 100 | + pip install -U sphinx |
| 101 | +
|
| 102 | +- Generate the docs locally |
| 103 | + |
| 104 | + .. code:: bash |
| 105 | +
|
| 106 | + cd DPPy/docs |
| 107 | + make html |
| 108 | +
|
| 109 | +- Open the local HTML version of the documentation located at |
| 110 | + ``DPPy/docs/_build/html/index.html`` |
| 111 | + |
| 112 | + .. code:: bash |
| 113 | +
|
| 114 | + open _build/html/index.html |
| 115 | +
|
| 116 | +If you wish pull request your contribution, please use the ``docs`` |
| 117 | +branch. |
| 118 | + |
| 119 | +How to cite this work? |
| 120 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 121 | + |
| 122 | +We wrote a companion paper to |
| 123 | +`DPPy <https://github.com/guilgautier/DPPy>`__ for latter submission to |
| 124 | +the `MLOSS <http://www.jmlr.org/mloss/>`__ track of JMLR. |
| 125 | + |
| 126 | +The companion paper is available on |
| 127 | + |
| 128 | +- `arXiv <http://arxiv.org/abs/1809.07258>`__ |
| 129 | +- `GitHub <https://github.com/guilgautier/DPPy_paper>`__, see the |
| 130 | + `arxiv <https://github.com/guilgautier/DPPy_paper/tree/arxiv>`__ |
| 131 | + branch |
| 132 | + |
| 133 | +If you use this package, please consider citing it with this piece of |
| 134 | +BibTeX: |
| 135 | + |
| 136 | +.. code:: bibtex |
| 137 | +
|
| 138 | + @article{GaBaVa18,, |
| 139 | + archivePrefix = {arXiv}, |
| 140 | + arxivId = {1809.07258}, |
| 141 | + author = {Gautier, Guillaume and Bardenet, R{\'{e}}mi and Valko, Michal}, |
| 142 | + eprint = {1809.07258}, |
| 143 | + journal = {ArXiv e-prints}, |
| 144 | + title = {{DPPy: Sampling Determinantal Point Processes with Python}}, |
| 145 | + keywords = {Computer Science - Machine Learning, Computer Science - Mathematical Software, Statistics - Machine Learning}, |
| 146 | + url = {http://arxiv.org/abs/1809.07258}, |
| 147 | + year = {2018}, |
| 148 | + note = {Code at http://github.com/guilgautier/DPPy/ Documentation at http://dppy.readthedocs.io/} |
| 149 | + } |
| 150 | +
|
| 151 | +Reproducibility |
| 152 | +--------------- |
| 153 | + |
| 154 | +We would like to thank `Guillermo Polito <https://guillep.github.io/>`__ |
| 155 | +for leading our reproducible research |
| 156 | +`workgroup <https://github.com/CRIStAL-PADR/reproducible-research-SE-notes>`__, |
| 157 | +this project owes him a lot. |
| 158 | + |
| 159 | +Take a look at the corresponding |
| 160 | +`booklet <https://github.com/CRIStAL-PADR/reproducible-research-SE-notes>`__ |
| 161 | +to learn more on how to make your research reproducible! |
| 162 | + |
| 163 | +.. |Documentation Status| image:: https://readthedocs.org/projects/dppy/badge/?version=latest |
| 164 | + :target: https://dppy.readthedocs.io/en/latest/?badge=latest |
| 165 | +.. |Build Status| image:: https://travis-ci.com/guilgautier/DPPy.svg?branch=master |
| 166 | + :target: https://travis-ci.com/guilgautier/DPPy |
| 167 | +.. |Google Colab| image:: https://badgen.net/badge/Launch/on%20Google%20Colab/blue?icon=terminal |
| 168 | + :target: https://colab.research.google.com/github/guilgautier/DPPy/blob/master/notebooks/Tuto_DPPy.ipynb |
0 commit comments