Skip to content

Simple library implementing Spectral-normalized Neural Gaussian Processes in PyTorch

License

Notifications You must be signed in to change notification settings

norabelrose/sngp-torch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sngp-torch

This is a simple library implementing Spectral-normalized Neural Gaussian Processes (SNGP) from the paper "A Simple Approach to Improve Single-Model Deep Uncertainty via Distance-Awareness" (Liu et al. 2022) in PyTorch. SNGP is a technique for enhancing the uncertainty estimation capabilities of deep neural networks, especially on out-of-distribution inputs, with negligible computational overhead and without sacrificing accuracy. It consists of two parts:

  1. Applying spectral normalization to the linear and convolutional layers of the network. This enforces an upper bound on the Lipschitz constant of the network, ensuring that inputs which are close in the data manifold are not too far apart in the latent space of the penulimate layer of the network. Spectral normalization is already implemented in base PyTorch as torch.nn.utils.parameterization.spectral_norm.
  2. Replacing the final layer of the network with an approximate Gaussian Process based on Random Fourier Features.

About

Simple library implementing Spectral-normalized Neural Gaussian Processes in PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages