Skip to content

ziatdinovmax/GP

Repository files navigation

This repo will now be developed and maintained https://github.com/ziatdinovmax/GPim

GP (Archieved)

Gaussian processes (GP) for 2D and hyperspectral microscopy data analysis and measurements based on Pyro probabilistic programming language. See also our paper at https://arxiv.org/abs/1911.11348.

To use it, first run:

git clone https://github.com/ziatdinovmax/GP.git
cd GP
python3 -m pip install -r req.txt

To perform GP-based reconstruction of sparse 2D image or sparse hyperspectral 3D data (datacube where measurements (spectroscopic curves) are missing for various xy positions), run:

python3 reconstruct.py <path/to/file.npy>

The missing values in the sparse data must be NaNs. If the data provided doesn't have missing values, it will be interpreted as a ground truth and a sparse copy of this dataset will be created. You can control the sparsity by passing --PROB argument (use python3 reconstruct.py -h to see other optional arguments). The reconstruct.py will return a zipped archive (.npz format) of numpy files corresponding to the ground truth (if applicable), input data, predictive mean and variance, and learned kernel hyperparameters. You can use python3 plot.py <path/to/file.npz> to view the results.

To perform GP-guided sample exploration with hyperspectral (3D) measurements based on the reduction of maximal uncertainty, run:

python3 explore.py <path/to/file.npy>

Notice that the exploration part currently runs only "synthetic experiments" where you need to provide a full dataset (no missing values) as a ground truth.

See also our executable Googe Colab notebook with examples of applying GP to both hyperspectral data reconstruction and sample exploration in band excitation scanning probe microscopy.

It is strongly recommended to run the codes with a GPU hardware accelerator. If you don't have a GPU on your local machine, you may rent a cloud GPU from Google Cloud AI Platform. Running the example notebook one time from top to bottom will cost about 1 USD with a standard deep learning VM instance (one P100 GPU and 15 GB of RAM).

More details TBA

About

This repo will now be developed and maintained https://github.com/ziatdinovmax/GPim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published