All models

neural_process_encoder_decoder

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

49 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 (37 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
199.2K
Operations
49
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
m7671
Graph hash
cd938b7733ed1739685cd5eda00ebdcb8cc125553416ed6ff43aa6cb9587fb3c
Skeleton hash
dea82d47c2f8d6e38c135e0399662b07af599a1efcf7ffdd44938847c213ef25
Architecture hash
fea688d250faeda5fabf67aebfa292e7483d8a64f26b7c8fc69f7204063e126d
Diagram SHA-256
181f30f780334543a6ba6c48e8b31835f8a0eb0d550838c328559dfdb548f457
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

A torch.nn stand-in with a deterministic encoder, mean aggregation and a decoder and no latent variable, closer to a Conditional Neural Process.

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