Skip to content

Machine learning models for estimating aleatoric and epistemic uncertainty with evidential and ensemble methods.

License

Notifications You must be signed in to change notification settings

ai2es/miles-guess

Repository files navigation

MILES-Guess

Generalized Uncertainty for Earth System Science (GUESS)

Developed by the Machine Ingetration and Learning for Earth Systems (MILES) group at the NSF National Center for Atmospheric Research (NCAR), Boulder CO, USA

Contributors

  • John Schreck
  • David John Gagne
  • Charlie Becker
  • Gabrielle Gantos
  • Dhamma Kimpara
  • Thomas Martin

Documentation

Full documentation is here.

Quick Setup

Install in your Python environment with the following command:

pip install miles-guess

If you want to install a particular backend (tensorflow, tensorflow_gpu, torch, jax):

pip install miles-guess[<backend>]

Setup from Scratch

Install the Miniconda Python installer available here.

First clone the miles-guess repo from github.

git clone https://github.com/ai2es/miles-guess.git`
cd miles-guess

Create a conda environment for non-Casper/Derecho users:

mamba env create -f environment.yml`
conda activate guess`

Create a conda environment for Casper/Derecho users including Tensorflow 2.15 with GPU support.

mamba env create -f environment_gpu.yml`
conda activate guess

Using miles-guess

The law of total variance for each model prediction target may be computed as

$$LoTV = E[\sigma^2] + Var[\mu]$$

which is the sum of aleatoric and epistemic contributions, respectively. The MILES-GUESS package contains options for using either Keras or PyTorch for computing quantites according to the LoTV as well as utilizing Dempster-Shafer theory uncertainty in the classifier case.

For detailed information about training with Keras, refer to the Keras training details README. There three scripts for training three regression models, and one for training categorical models. The regression examples are trained on our surface layer ("SL") dataset for predicting latent heat and other quantities, and the categorical example is trained on a precipitation dataset ("p-type").

For pyTorch, please visit the the pyTorch training details README where details on training scripts for both evidential standard classification tasks are detailed. Torch examples use the same datasets as the Keras models. The torch training code will also scale on GPUs, and is compatitible with DDP and FSDP.