Re-Envisioning Numerical Information Field Theory (NIFTy.re)

Re-Envisioning Numerical Information Field Theory (NIFTy.re): A Library for Gaussian Processes and Variational Inference - Published in JOSS (2024)

https://github.com/nifty-ppl/nifty

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Committers with academic emails
    38 of 63 committers (60.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Mathematics Computer Science - 43% confidence
Last synced: 6 months ago · JSON representation

Repository

Probabilistic programming framework for signal inference algorithms that operate regardless of the underlying grids and their resolutions

Basic Info
Statistics
  • Stars: 34
  • Watchers: 6
  • Forks: 4
  • Open Issues: 7
  • Releases: 4
Created about 2 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License

README.md

NIFTy - Numerical Information Field Theory

pipeline status coverage report

NIFTy project homepage: ift.pages.mpcdf.de/nifty | Found a bug? github.com/nifty-ppl/nifty/issues | Need help? github.com/nifty-ppl/nifty/discussions

NIFTy, "Numerical Information Field Theory", is a Bayesian inference library. It is designed to compute statistical properties of high-dimensional posterior probability distributions (tested up to billions of parameters) from noisy input data. At the core of NIFTy lies a set of Gaussian Process (GP) models and Variational Inference (VI) algorithms - in particular Metric Gaussian Variational Inference (MGVI) and Geometric Gaussian Variational Inference (geoVI).

There are two independent implementation variants of NIFTy:

These variants share lots of functionality:

  • Similar VI algorithms
  • Similar GP models
  • Similar interfaces (e.g., nifty.cl/re.optimize_kl and nifty.cl/re.CorrelatedFieldMaker)
  • Both can run on CPUs and GPUs

The major differences between them are:

  • Philosophy: nifty.cl provides hackable transparent building blocks to explore discretization-independent Bayesian inference algorithms with minimal dependencies. On the other hand, nifty.re is built around JAX, provides a more direct numpy-like interface and aims for high performance out of the box.
  • Backend: numpy/cupy (nifty.cl) vs JAX (nifty.re).
  • Performance: nifty.re leverages JIT from JAX and thereby runs generally faster than nifty.cl.
  • Functionality: nifty.re supports HMC and Multi Grids. nifty.cl does not (yet).
  • API: In nifty.cl algorithms are implemented independent of the chosen discretization scheme represented explicitly by nifty.cl.Domains. nifty.re provides more direct access to arrays.
  • License: nifty.cl is distributed under GPL-3.0+. nifty.re is distributed under BSD-2-Clause or GPL-2.0+.

For a quick start, you can browse through the informal introduction or dive into NIFTy by running the scrips in the demos folder. The subfolders cl/ and re/ contain the scripts relevant for the respective NIFTy flavor.

NIFTy.re

Installation

NIFTy is distributed on PyPI. For a minimal installation of nifty.re run: pip install --user 'nifty[re]'

To install NIFTy.re with GPU support please manually install JAX following the instructions in the JAX installation guid.

If you might want to adapt the NIFTy source code, we suggest installing NIFTy as editable python package with a command such as:

git clone -b nifty https://gitlab.mpcdf.mpg.de/ift/nifty.git cd nifty pip install --user --editable '.[re]'

Run the tests

To run the tests, install all optional requirements 'nifty[all]' and afterwards run pytest (and create a coverage report) via

pytest -n auto --cov=nifty test

If you are writing your own tests, it is often sufficient to just install the optional test dependencies 'nifty[test]'. However, to run the full test suit including tests of optional functionality, it is assumed that all optional dependencies are installed.

Contributing

Contributions are very welcome! Feel free to reach out early on in the development process e.g. by opening a draft PR or filing an issue, we are happy to help in the development and provide feedback along the way. Please open an issue first if you think your PR changes current code substantially. Please format your code according to the existing style used in the file or with black for new files. To advertise your changes, please update the public documentation and the ChangeLog if your PR affects the public API. Please add appropriate tests to your PR.

Citing

To cite the probabilistic programming framework nifty.re, please use the citation provided below. In addition to citing NIFTy itself, please consider crediting the Gaussian process models you used and the inference machinery. See the corresponding entry on citing NIFTy in the documentation for further details.

@article{niftyre, title = {Re-Envisioning Numerical Information Field Theory (NIFTy.re): A Library for Gaussian Processes and Variational Inference}, author = {Gordian Edenhofer and Philipp Frank and Jakob Roth and Reimar H. Leike and Massin Guerdi and Lukas I. Scheel-Platz and Matteo Guardiani and Vincent Eberle and Margret Westerkamp and Torsten A. Enßlin}, year = {2024}, journal = {Journal of Open Source Software}, publisher = {The Open Journal}, volume = {9}, number = {98}, pages = {6593}, doi = {10.21105/joss.06593}, url = {https://doi.org/10.21105/joss.06593}, }

NIFTy.cl

nifty.cl is a versatile library designed to enable the development of signal inference algorithms that operate regardless of the underlying grids (spatial, spectral, temporal, …) and their resolutions. Its object-oriented framework is written in Python, although it accesses libraries written in C++ and C for efficiency.

NIFTy offers a toolkit that abstracts discretized representations of continuous spaces, fields in these spaces, and operators acting on these fields into classes. This allows for an abstract formulation and programming of inference algorithms, including those derived within information field theory. NIFTy's interface is designed to resemble IFT formulae in the sense that the user implements algorithms in NIFTy independent of the topology of the underlying spaces and the discretization scheme. Thus, the user can develop algorithms on subsets of problems and on spaces where the detailed performance of the algorithm can be properly evaluated and then easily generalize them to other, more complex spaces and the full problem, respectively.

The set of spaces on which NIFTy operates comprises point sets, n-dimensional regular grids, spherical spaces, their harmonic counterparts, and product spaces constructed as combinations of those. NIFTy takes care of numerical subtleties like the normalization of operations on fields and the numerical representation of model components, allowing the user to focus on formulating the abstract inference procedures and process-specific model properties.

Dependencies and installation

The latest version of nifty.cl can be installed from the sources:

pip install git+https://gitlab.mpcdf.mpg.de/ift/nifty@nifty

Releases can be found on PyPI:

pip install nifty

Both will install the basic required dependencies (numpy and scipy). Often users may choose to install optional dependencies to enable additional features.

  • ducc0: Use FFTs directly from ducc and enable several operators implemented directly in C++ for speed.
  • cupy: Enable GPU backend.
  • pyvkfft: Use vkFFT instead of cufft.
  • cufinufft: Enables nffts on the GPU.
  • mpi4py: Parallelize computations via MPI.
  • astropy: Save certain outputs as FITS files.
  • h5py: Save certain outputs as HDF5 files.
  • matplotlib: Enable plotting, e.g., via nifty.cl.Plot.

First Steps

For a quick start, you can browse through the informal introduction or dive into NIFTy by running one of the demonstrations, e.g.:

python3 demos/cl/getting_started_1.py

Testing

To run the tests pytest is required. The tests can be run using the following command in the repository root:

pytest test/test_cl

To run the full test suit including tests of optional functionality, it is assumed that all optional dependencies are installed.

Citing

@article{niftycl, author = {{Arras}, Philipp and {Baltac}, Mihai and {Ensslin}, Torsten A. and {Frank}, Philipp and {Hutschenreuter}, Sebastian and {Knollmueller}, Jakob and {Leike}, Reimar and {Newrzella}, Max-Niklas and {Platz}, Lukas and {Reinecke}, Martin and {Stadler}, Julia}, title = {{NIFTy5: Numerical Information Field Theory v5}}, keywords = {Software}, howpublished = {Astrophysics Source Code Library, record ascl:1903.008}, year = 2019, month = 03, eid = {ascl:1903.008}, pages = {ascl:1903.008}, archiveprefix = {ascl}, eprint = {1903.008} }

Building the Documentation

NIFTy's documentation is generated via Sphinx and is available online at ift.pages.mpcdf.de/nifty.

To build the documentation locally, run:

sudo apt-get install dvipng jupyter-nbconvert texlive-latex-base texlive-latex-extra pip install --user sphinx==8.1.3 jupytext pydata-sphinx-theme myst-parser sphinxcontrib-bibtex cd <nifty_directory> bash docs/generate.sh

To view the documentation, open docs/build/index.html in your browser.

Note: Make sure that you reinstall nifty after each change since sphinx imports nifty from the Python path.

Owner

  • Name: NIFTy-PPL
  • Login: NIFTy-PPL
  • Kind: organization

JOSS Publication

Re-Envisioning Numerical Information Field Theory (NIFTy.re): A Library for Gaussian Processes and Variational Inference
Published
June 15, 2024
Volume 9, Issue 98, Page 6593
Authors
Gordian Edenhofer ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany, Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany, Department of Astrophysics, University of Vienna, Türkenschanzstraße 17, A-1180 Vienna, Austria
Philipp Frank ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany
Jakob Roth ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany, Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany, School of Computation, Information and Technology, Technical University of Munich, Arcisstr. 21, 80333 München, Germany
Reimar H. Leike ORCID
Independent Researcher, USA
Massin Guerdi
Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany
Lukas I. Scheel-Platz ORCID
Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany, Helmholtz Zentrum München, Ingolstädter Landstraße 1, 85764 Neuherberg, Germany, School of Medicine and Health, Technical University of Munich, Ismaninger Str. 22, 81675 München, Germany
Matteo Guardiani ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany, Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany
Vincent Eberle ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany, Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany
Margret Westerkamp ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany, Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany
Torsten A. Enßlin ORCID
Max Planck Institute for Astrophysics, Karl-Schwarzschild-Straße 1, 85748 Garching bei München, Germany, Ludwig Maximilian University of Munich, Geschwister-Scholl-Platz 1, 80539 München, Germany
Editor
Dan Foreman-Mackey ORCID
Tags
Astronomy Imaging Gaussian Processes Variational Inference

GitHub Events

Total
  • Create event: 11
  • Release event: 1
  • Issues event: 10
  • Watch event: 13
  • Delete event: 1
  • Issue comment event: 35
  • Push event: 132
  • Pull request review event: 29
  • Pull request review comment event: 34
  • Pull request event: 6
  • Fork event: 2
Last Year
  • Create event: 11
  • Release event: 1
  • Issues event: 10
  • Watch event: 13
  • Delete event: 1
  • Issue comment event: 35
  • Push event: 132
  • Pull request review event: 29
  • Pull request review comment event: 34
  • Pull request event: 6
  • Fork event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 7,019
  • Total Committers: 63
  • Avg Commits per committer: 111.413
  • Development Distribution Score (DDS): 0.746
Past Year
  • Commits: 478
  • Committers: 11
  • Avg Commits per committer: 43.455
  • Development Distribution Score (DDS): 0.676
Top Committers
Name Email Commits
Martin Reinecke m****n@m****e 1,783
Gordian Edenhofer g****r@g****m 1,348
Philipp Arras p****s@m****e 1,271
theos t****r@u****e 388
Philipp Arras c@p****e 319
Philipp Frank p****p@m****e 314
Vincent Eberle v****e@m****e 127
Jakob Roth r****h@m****e 120
Theo Steininger t****s@m****e 117
Marco Selig m****g@n****E 113
Reimar Leike r****r@l****e 106
Massin Guerdi m****i@w****e 93
Lukas Platz l****s@l****e 90
dpumpe d****e@m****e 82
Jait Dixit j****t@t****e 76
Knollmueller, Jakob (kjako) j****b@k****e 67
Reimar Leike r****r@m****e 61
Lukas Platz l****z@m****e 56
csongor c****y@g****m 52
Theo Steininger t****r@i****i 52
matteani m****i@m****e 39
Vincent Eberle VE@V****x 38
Torsten Ensslin e****n@m****e 29
Philipp Haim p****m@g****m 28
Reimar Leike r****r@m****e 27
Laurin Soeding s****g@p****e 26
Rouven Lemmerz l****z@m****e 20
Jakob Knollmüller j****r@M****x 20
ultimanet t****r@p****e 16
Mihai Baltac b****i@g****m 15
and 33 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 18
  • Total pull requests: 18
  • Average time to close issues: 28 days
  • Average time to close pull requests: 23 days
  • Total issue authors: 9
  • Total pull request authors: 3
  • Average comments per issue: 2.28
  • Average comments per pull request: 1.33
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 4
  • Average time to close issues: 2 months
  • Average time to close pull requests: 22 days
  • Issue authors: 4
  • Pull request authors: 1
  • Average comments per issue: 2.43
  • Average comments per pull request: 0.75
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • apizzuto (5)
  • fmkroci (4)
  • ph-frank (2)
  • matteani (2)
  • patrikbar (1)
  • roth-jakob (1)
  • Abinashbunty (1)
  • Edenhofer (1)
  • phaim (1)
  • StandingWaves (1)
Pull Request Authors
  • Edenhofer (21)
  • ph-frank (10)
  • dfm (2)
Top Labels
Issue Labels
enhancement (2) jax (2) good first issue (1) bug (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 611 last-month
  • Total dependent packages: 3
    (may contain duplicates)
  • Total dependent repositories: 6
    (may contain duplicates)
  • Total versions: 22
  • Total maintainers: 4
pypi.org: nifty

Probabilistic programming framework for signal inference algorithms that operate regardless of the underlying grids and their resolutions

  • Versions: 9
  • Dependent Packages: 1
  • Dependent Repositories: 5
  • Downloads: 342 Last month
Rankings
Dependent repos count: 6.6%
Dependent packages count: 10.1%
Average: 13.2%
Downloads: 23.0%
Maintainers (1)
Last synced: 6 months ago
pypi.org: nifty8

Probabilistic programming framework for signal inference algorithms that operate regardless of the underlying grids and their resolutions

  • Versions: 13
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 269 Last month
Rankings
Dependent packages count: 10.0%
Average: 16.1%
Downloads: 16.4%
Dependent repos count: 21.7%
Maintainers (3)
Last synced: 6 months ago

Dependencies

Dockerfile docker
  • debian bullseye-slim build
pyproject.toml pypi
setup.py pypi
  • numpy >=1.19
  • scipy >=1.4.1