Wavelet Phase Harmonics in Python with GPU acceleration.
Project description
PyWPH: Wavelet Phase Harmonics in Python
PyWPH is a Python package for computing and handling Wavelet Phase Harmonic (WPH) statistics.
These statistics can be derived from both real and complex-valued 2D data (e.g., images). Calculations are GPU-accelerated using PyTorch (torch>=1.9.0). Refer to the PyTorch installation guide for setting up PyTorch.
Features
- GPU-accelerated computations with support for low-memory GPUs through efficient chunk-based processing.
- Support for real and complex-valued 2D data.
- Cross-WPH statistics for cross-statistical analysis.
- Ready-to-use examples for syntheses (including multi-channel synthese in external repository) and statistical denoising
Installation
Install PyWPH via PyPI:
pip install pywph
Alternatively, install form source:
git clone https://github.com/bregaldo/pywph.git
cd pywph
pip install .
To uninstall:
pip uninstall pywph
Documentation and Examples
Explore the following resources to get started:
- 📖 Tutorial: A step-by-step introduction to PyWPH.
- 📂 Examples folder: Basic examples for computing WPH coefficients and advanced applications such as synthesis and statistical denoising.
- 🖼️ Multi-channel synthesis examples are available in this repository.
For a detailed presentation of the WPH statistics implemented in this package, refer to the paper: arXiv:2208.03538.
Citing PyWPH
If you use PyWPH in your research, please cite the following paper:
- Regaldo-Saint Blancard, B., Allys, E., Boulanger, F., Levrier, F., & Jeffrey, N. "A new approach for the statistical denoising of Planck interstellar dust polarization data", Astronomy & Astrophysics 649, L18 (2021). ArXiv: 2102.03160
@article{regaldo2021,
author = {{Regaldo-Saint Blancard}, Bruno and {Allys}, Erwan and {Boulanger}, Fran{\c{c}}ois and {Levrier}, Fran{\c{c}}ois and {Jeffrey}, Niall},
title = "{A new approach for the statistical denoising of Planck interstellar dust polarization data}",
journal = {Astronomy \& Astrophysics},
year = 2021,
month = may,
volume = {649},
eid = {L18},
pages = {L18},
doi = {10.1051/0004-6361/202140503},
archivePrefix = {arXiv},
eprint = {2102.03160},
primaryClass = {astro-ph.CO},
}
Related References
- Mallat, S., Zhang, S., & Rochette, G. "Phase harmonic correlations and convolutional neural networks", Information and Inference: A Journal of the IMA, 9(3), 721–747. (2020). ArXiv: 1810.12136.
- Allys, E., Marchand, T., Cardoso, J.-F., Villaescusa-Navarro, F., Ho, S., & Mallat, S. "New Interpretable Statistics for Large Scale Structure Analysis and Generation", Physical Review D, 102(10), 103506. (2020). ArXiv: 2006.06298.
- Zhang, S., & Mallat, S. "Maximum Entropy Models from Phase Harmonic Covariances", Applied and Computational Harmonic Analysis, 53, 199–230 (2021). ArXiv: 1911.10017.
- Régaldo-Saint Blancard, B., Allys, E., Auclair, C., Boulanger, F., Eickenberg, M., Levrier, F., Vacher, L. & Zhang, S. "Generative Models of Multi-channel Data from a Single Example - Application to Dust Emission", The Astrophysical Journal, 943, 9 (2023) ArXiv: 2208.03538. Code.
This package took inspiration from https://github.com/Ttantto/wph_quijote.
Changelog
v1.1
- New default discretization grid for the shift vector $\tau$.
- New set of scaling moments $L$ (which replaced the old ones).
- Version used in arXiv:2208.03538.
v1.0
- Added cross-WPH statistics.
- Smarter way to evaluate moments at different $\tau$.
- Improved computation for non-periodic boundary conditions data.
v0.9
- Initial release, corresponding to arXiv:2102.03160.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywph-1.1.3.tar.gz.
File metadata
- Download URL: pywph-1.1.3.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc8d91ea8fd9db68f4b869c943fe58e05efaf388a0c0d82208f40557e312c9a6
|
|
| MD5 |
acb2132fafc8a0eb9f473feb6df8545d
|
|
| BLAKE2b-256 |
7667f80e1274004d94b85441403c793abbffd379a6f307c744fd36389da6b1b2
|
File details
Details for the file pywph-1.1.3-py3-none-any.whl.
File metadata
- Download URL: pywph-1.1.3-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6eab5a4448f3f61cd17924c3e6bb6485bb12ef4ab98b7c8b7cddf3b7fe96f5d
|
|
| MD5 |
2a8f8b3f5b09f583cca22a67a672e073
|
|
| BLAKE2b-256 |
585689da84224524bfbd184cf65375b234cc10841c3a59929d51b5727c42cacb
|