Installation¶
gpmp-contrib is a Python package that depends on gpmp. The package
metadata declares:
Python
>= 3.9.numpy.scipy >= 1.12.0.matplotlib.gpmp >= 0.9.37.
Install from a local checkout with:
python -m pip install -e .
The examples and documentation assume that gpmp is importable in the same
environment. gpmp selects a numerical backend at import time. Arrays
returned by gpmp-contrib are backend objects: NumPy arrays with the NumPy
backend and PyTorch tensors with the PyTorch backend. In ordinary
ModelContainer usage, inputs are converted by the called method and
prediction outputs are NumPy arrays by default. Use gpmp.num when writing
backend-independent code around gpmp.core or gpmp.kernel calls.
Minimal import check¶
import gpmp as gp
import gpmp.num as gnp
import gpmpcontrib as gpc
print(gp.__version__)
print(gpc.__version__)
x = gnp.asarray([[0.0], [1.0]])
Build the documentation¶
The documentation sources are in docs/source. Build the HTML pages with:
pip install -r docs/requirements.txt
cd docs
sphinx-build -M html source _build -E
The example result figures are generated by:
cd docs
python make_example_results.py
Figure-generation uses a non-interactive Matplotlib backend and writes PNG
files in docs/source/_static/example_results.