This release is a pre-release and may not be stable for production use.
HMC Lab
Andrea Zunino, Lars Gebraad, Andreas Fichtner
HMC Lab is a numerical laboratory for research in Bayesian seismology, written in Python and Julia. Jump to Docker one-command setup.
- Website: https://hmclab.science
- Python documentation: https://python.hmclab.science
- Source code: https://github.com/larsgeb/hmclab
- Docker image: https://hub.docker.com/repository/docker/larsgebraad/hmclab
- Bug reports: https://github.com/larsgeb/hmclab/issues
It provides all the ingredients to set up probabilistic (and deterministic) inverse problems, appraise them, and analyse them. This includes a plethora of prior distributions, different physical modelling modules and various MCMC (and other) algorithms.
In particular it provides prior distributions, physics and appraisal algorithms.
Prior distributions:
- Normal
- Laplace
- Uniform
- Arbitrary composites of other priors
- Bayes rule
- User supplied distributions
Physics:
- Linear equations
- Straight ray tomography
- 3d source location
- 2d elastic full-waveform inversion
- User supplied physics
Algorithms:
- Hamiltonian Monte Carlo (and variations)
- Random Walk Metropolis Hastings
- Stein Variational Gradient Descent
- Gradient descent
- Interfaces to non-linear optimization methods from SciPy
- Animated versions of various algorithms
Docker one-command setup
To get staerting with the tutorial and example notebooks, one can use a single command in Docker. This will pull a Docker image based on the Jupyter Datascience stack. The final container is approximately 5GB.
docker run -p 9123:9123 larsgebraad/hmclab \
start-notebook.sh --NotebookApp.token='hmclab' \
--NotebookApp.port='9123' --LabApp.default_url='/lab/tree/Home.ipynb'
Then either copy-past the link from your terminal, or navigate manually to http://127.0.0.1:9123/lab/tree/Home.ipynb?token=hmclab.
Online tutorial notebooks
All tutorial notebooks can also be accessed online in a non-interactive fashion. Simply use https://python.hmclab.science or use the following links:
Tutorials:
- Getting started.ipynb
- Tuning Hamiltonian Monte Carlo.ipynb
- Separate priors per dimension.ipynb
- Creating your own inverse problem.ipynb
- Running parallel Markov chains.ipynb
Demos:
- Sampling linear equations
- Sampling sparse linear equations
- Locating quakes on Grimsvötn, Iceland
- Elastic 2d FWI
The long way around: installing the package on your system
For full installation instructions, including creating a proper Python environment, see the installation instructions.
Start with making sure that you have HDF5 or h5py installed properly.
Directly to your environment:
pip install -e git+git@github.com:larsgeb/hmclab.git@master#egg=hmclab
From the project root directory:
pip install -e .
Development dependencies
If you want to develop within this repo, we recommend a few extra packages. They can also be installed using pip.
In Bash:
pip install -e git+git@github.com:larsgeb/hmclab.git@master#egg=hmclab[dev] # from github repo
pip install -e .[dev] # from local clone
... or Zsh (which requires escapes for brackets):
pip install -e git+git@github.com:larsgeb/hmclab.git@master#egg=hmclab\[dev\] # from github repo
pip install -e .\[dev\] # from local clone
Metadata
Release files for hmclab 1.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hmclab-1.0rc1.tar.gz | 97.1 kB | Without provenance | Details for hmclab-1.0rc1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hmclab-1.0rc1-py3-none-any.whl | Python 3 | none | any | Details for hmclab-1.0rc1-py3-none-any.whl |
Total release size: 169.2 kB
Release files / hmclab-1.0rc1.tar.gz
| Download URL | hmclab-1.0rc1.tar.gz |
|---|---|
| Size | 97.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c26425387c6fd8ddbdbc919d26c1945ffea2d427a9e5b7b4cd4be05e3a2f5092
|
|
BLAKE2b-256 checksum How to use checksums |
b2f1e2dfe486fae15477c0b5bd918406ff2ac3bf800c7fb42b5f682d64e41a46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / hmclab-1.0rc1-py3-none-any.whl
| Download URL | hmclab-1.0rc1-py3-none-any.whl |
|---|---|
| Size | 72.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2299628cab13472559cae1c42f71f1c54676030711df813b636e44b823222de2
|
|
BLAKE2b-256 checksum How to use checksums |
2426b3ea3b2db4a4da15d2a6c343cd09ca1839a6f39cb9fb372ebd73fe5d55b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for hmclab 1.0rc1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.