/sngp-pytorch

Spectral-normalized Neural Gaussian Process (SNGP) implementation in PyTorch

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

sngp-pytorch

Spectral-normalized Neural Gaussian Process (SNGP) implementation in PyTorch (DEMO).

Environment

Important: recommended having Jupyter Lab installed in the base conda environment. For the best experience, you may also install nb_conda_kernels and ipywidgets in the base conda environment. Also, using mamba is recommended.

  1. Basic conda setup:

    1. download Miniconda
    $ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    1. install it
    $ bash Miniconda3-latest-Linux-x86_64.sh
    1. reload your terminal, so that base environment is activated
    2. install essential packages
    $ conda install -c conda-forge "mamba>0.18"
    $ mamba install -c conda-forge jupyterlab jupyterlab_widgets nodejs nb_conda_kernels
    $ jupyter labextension install @jupyter-widgets/jupyterlab-manager
  2. Create conda environment (double-check that name in environment.yaml coincides with the one in the commands below!); using update as proposed here:

    $ conda create -n develop-env
    $ mamba env update -n develop-env --file environment.yaml
  3. Activate it:

    $ conda activate develop-env

Development

Environment

  1. Install pre-commit (config provided in this repo)
    $ pre-commit install
  2. (optional) Run against all the files to check the consistency
    $ pre-commit run --all-files
  3. You may also run black and isort to keep the files style-compliant
    $ isort .; black .
  4. Proposed linter is flake8
    $ flake8 .

Installation (editable mode)

python -m pip install -e .

Deinstallation

python -m pip uninstall sngp-pytorch