
neural_process_encoder_decoder
49 ops199.2K params
Neural Processes: an encoder, a mean aggregator and a decoder that together learn a distribution over functions.
36 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
The paper's NP as built in the official notebook, which holds both the NP and ANP code.
About this model's family
Neural Processes, NPs, are latent variable models that aim at the best of two worlds: the function distributions of Gaussian processes and the cheap training of neural networks. Like a GP, an NP defines a distribution over functions, adapts quickly to new observations and estimates its own uncertainty. Like a neural network, it is computationally efficient at training and test time, and it learns its prior from data.
The implementation starts with an encoder h that maps each context pair of x and y to a representation. An aggregator a averages those representations into one order-invariant summary, which keeps the runtime linear in the number of context and target points. That summary parameterises a global latent variable z, and a decoder g takes a sample of z with new target locations and outputs predictions for their values. Training maximises an evidence lower bound, the ELBO, on the log likelihood of the targets.
NPs generalise Conditional Neural Processes, which share the motivation but lack the latent variable. Without it a CNP cannot produce different function samples for the same context. The official repository ships NPs as notebooks alongside Conditional and Attentive Neural Processes, with the NP and ANP code sharing one notebook. The torch.nn member is a stand-in with a deterministic encoder, mean aggregation and an MLP decoder but no latent path, which places it closer to a Conditional Neural Process than to the full NP. A third-party PyTorch implementation in the folder offers function regression and image inpainting examples.
Key idea. A neural latent variable model that defines distributions over functions like a GP yet trains and evaluates as cheaply as a neural network.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{garnelo2018neuralprocesses,
title={Neural Processes},
author={Marta Garnelo and Jonathan Schwarz and Dan Rosenbaum and Fabio Viola and Danilo J. Rezende and S. M. Ali Eslami and Yee Whye Teh},
year={2018},
eprint={1807.01622},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.01622},
}