All models

Neural Process (NP)

Neural Processes: an encoder, a mean aggregator and a decoder that together learn a distribution over functions.

36 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (40 KB)

Open in a new tab

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.

At a glance

Parameters
132.9K
Operations
36
Framework
PyTorch
Recurrent
No
Published
ICML 2018 Workshop on Theoretical Foundations and Applications of Deep Generative Models
Cited by
146 (as of 18 October 2026)
Authors
Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m27135
Graph hash
4297d21cfd86a822d01e84b8b2fb2177da7f14bfd2597a441647d7e421b8ca5d
Skeleton hash
f2635952ee11fbe01c2f97954a2e9794e754ce935c54705ed7337928c09a44b7
Architecture hash
a42b1de786462d36f0ce4025672da31529c0f34fd4c78249196612432fe23f54
Diagram SHA-256
76a845e9bace82bd81899dc6ef9aad43299d61f0c43fa47f806e114281190a25
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

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.

  • neural process
  • neural processes
  • np
  • conditional neural process
  • cnp
  • attentive neural process
  • stochastic process
  • gaussian process alternative
  • meta-learning
  • function regression

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@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}, 
}