Skip to main content

Package for solving inverse problems and quantifying their uncertainties via general polynomial chaos.

Project description

PyThia Logo Full

Uncertainty Quantification Toolbox

The PyThia UQ toolbox uses polynomial chaos surrogates to efficiently generate a surrogate of any (parametric) forward problem. The surrogate is fast du evaluate, allows analytical differentiation and has a built-in global sensitivity analysis via Sobol indices. Assembling the surrogate is done non-intrusive by least-squares regression, hence only training pairs of of parameter realizations and evaluations of the forward problem are required to construct the surrogate. No need to compute any nasty interfaces for lagacy code.

Why the Name?

Pythia was the title of the high priestess of the temple of Apollo in Delphi. Hence you could say she used her prophetic abilities to quantify which was uncertain. Moreover, the package is written in python, so...

Installation of PyThia

If using Anaconda, simply clone the repository and create a new environment called pythia with pip installed

conda create --name pythia pip

Activate the environment with conda activate pythia and run the setup script to install PyThia to any environment

cd path/to/pythia
pip install .

PyThia can then be imported from any location with import pythia.

Documentation of PyThia

The documentation can be generated automatically using sphinx. Assuming you have sphinx and the sphinx_rtd_theme installed, the documentation can be generated by

cd docs
make html

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

Want to contribute?

Check out the contribution guidelines on how to create issues or file bug reports and feature requests. Or ever better start developping the PyThia project yourself after reading the development guidelines.

Roadmap and TODOs

Before the first official release there are several TODOs that need to be dealt with:

  • add (correct) LICENSE file for the package according to PTB regulations
  • add CODE_OF_CONDUCT and guides for CONTRIBUTING and DEVELOPERS
  • add CHANGELOG to clarify what and when things were changed
  • fix a branching model and update the description of it in DEVELOPERS
  • fix a release policy
  • upon release, make the project available at PyPI.org for easy pip installation
    • make it easy to install different versions
  • make the code citeable
  • automatically install dependencies (Numpy and SciPy versions)

After making the project public, there are a few necessary user experience changes that should be done:

  • create stack overflow hashtag for PyThia
  • create a homepage
  • add tutorials (jupyter notebook and as downloadable .py file) to homepage
  • add docstrings to the code and clean the superficially to make it more readable without changing any functionality
  • create an auto-doc with Sphinx
  • write unit, mock and integration tests
  • use CD and CI to test and deploy new releases of pythia
  • create html-doc automatically when new version is released and upload it to Homepage

Finally, here is a roadmap of features that we plan to add to pythia in the future.

  • speed up evaluation of basis polynomials
  • integrate tensor train representations of coefficients
  • add tensor train regression (VMC)
  • add exponentiation of tensor trains (expTT)
  • add efficient posterior rejection sampling for tensor trains posteriors (Dolgov paper)

References

Here we list the papers that describe concepts implemented in PyThia for the interested user. In principle PyThia uses a (sparse) polynomial chaos expansion to construct a surrogate of any function via least-squares regression. We first applied the PyThia software package to analyse the sensitivities of a scatterometry experiment [^pythia-scat-A] using global sensitivity analysis via Sobol indices [^sobol-indices]. We also solved the inverse problem for the same experiment [^pythia-scat-B] via Bayesian inversion. To use a minimal but still sufficient amount of random samples for the regression, we integrated weighted least-squares sampling [^wls-sampling] into PyThia.

[^pythia-scat-A]: An efficient approach to global sensitivity analysis and parameter estimation for line gratings [^pythia-scat-B]: Efficient Bayesian inversion for shape reconstruction of lithography masks [^sobol-indices]: Global sensitivity analysis using polynomial chaos expansions [^wls-sampling]: Optimal weighted least-squares methods

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythia-uq-2.0.0.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythia_uq-2.0.0-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file pythia-uq-2.0.0.tar.gz.

File metadata

  • Download URL: pythia-uq-2.0.0.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for pythia-uq-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4c84e5402168df60c563547b2b9302f3dd866bd4b2c1d8352f5dafdb76960042
MD5 e2f1c801101c02df90ae7010c5990127
BLAKE2b-256 3b9abb79f731237f9cf81991bff0fc6895cd7161d4bd4aab0ba6a2ad54b1939a

See more details on using hashes here.

File details

Details for the file pythia_uq-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pythia_uq-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for pythia_uq-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abec26a92ca577d8ff90cbbfb129f91c454fb9c8a7459f776fa5825b992a3a1d
MD5 5048f5bf9aecd8d0dd6f74ef3b4b6aae
BLAKE2b-256 a6fbf7a2ace649e3bab5347f37344e59b136d1dcbdc070b028ad86c7fae73645

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page