titospadini / GP4A

Code for NeurIPS 2019 paper: "Wide Feedforward or Recurrent Neural Networks of Any Architecture are Gaussian Processes"

Home Page:https://arxiv.org/abs/1910.12478

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gaussian Process for Any Neural Architecture: Reference Implementations

This repo is a companion to the paper

Tensor Programs I: Wide Feedforward or Recurrent Neural Networks of Any Architecture are Gaussian Processes
Greg Yang

which shows that the Gaussian process behavior arises in wide, randomly initialized, neural networks regardless of architecture.

Despite what the title suggests, this repo does not implement the infinite-width GP kernel for every architecture, but rather demonstrates the derivation and implementation for a few select architectures.

Architecture Notebook Colab
Simple RNN Notebook Open In Colab
GRU Notebook Open In Colab
Transformer Notebook Open In Colab
Batchnorm+ReLU MLP Notebook Open In Colab

Plots.ipynb also reproduces Figure (3) of the paper.

We have included the GloVe embeddings ExampleGloVeVecs.npy of example sentences we feed into the networks, as well as their normalized Gram matrix ExampleGloVeCov.npy. GloVe.ipynb recreates them; if you wish to try the kernels on custom sentences, then modify GloVe.ipynb as appropriate.

About

Code for NeurIPS 2019 paper: "Wide Feedforward or Recurrent Neural Networks of Any Architecture are Gaussian Processes"

https://arxiv.org/abs/1910.12478


Languages

Language:Jupyter Notebook 97.9%Language:Python 2.1%