SkillAgentSearch skills...

GP4A

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

Install / Use

/learn @thegregyang/GP4A
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Gaussian Process for Any Neural Architecture: Reference Implementations

Update July 2020

The 2nd paper in the Tensor Programs series, Neural Tangent Kernel for Any Architecture, is now out! It shows that the infinite-width limit of a neural network of any architecture is well-defined (in the technical sense that the tangent kernel (NTK) of any randomly initialized neural network converges in the large width limit) and can be computed. The associated repo implements this infinite-width neural network for RNN, Transformer, and a Batchnorm+ReLU MLP.


This repo is a companion to the paper

Tensor Programs I: Wide Feedforward or Recurrent Neural Networks of Any Architecture are Gaussian Processes<br> 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.

<p> <img src="allkernels.png" width="1000" > </p>

Related Skills

View on GitHub
GitHub Stars252
CategoryDevelopment
Updated15d ago
Forks21

Languages

Jupyter Notebook

Security Score

80/100

Audited on Mar 17, 2026

No findings