All models

Janossy Pooling

Order-invariant pooling by averaging an order-sensitive network over reorderings of a set.

Graphs and geometry · 9 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 (11 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
11.2K
Operations
9
Framework
PyTorch
Recurrent
No
Published
ICLR 2019
Cited by
58 (as of 5 October 2026)
Authors
Ryan L. Murphy, Balasubramaniam Srinivasan, Vinayak Rao, Bruno Ribeiro
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
m14390
Graph hash
417a9802c58d06b1d95dfa1f7c274f759d12257b90914cbb7d3df8f0ca998472
Skeleton hash
0e0f9d9a8146fd389576949d536c2085b674880b7d4f0cdf90b5d2dc7eda0a98
Architecture hash
8d293f8414f11bbf6c1f6ef015b99e1fa761eb4ef6f4816cb27ce7b5cb4663ca
Diagram SHA-256
988cd53057a4033a437b9944d96f25ef936d1312e4b243ecc52b6a57a3ec8bb0
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

Janossy Pooling is a recipe for turning any order-sensitive neural network into one whose answer does not depend on the order of its inputs, which is what you want when the input is really a set. The idea is almost embarrassingly direct: apply a permutation-sensitive function to every reordering of the input and average the results. Averaging over every ordering is far too expensive for anything but tiny inputs, so the paper offers three ways to cut the cost: a canonical ordering, functions that only look at k-way interactions, and stochastic training with random permutations.

Familiar models fall out as special cases: DeepSets is the unary case, where the function reads only one element at a time. GraphSAGE can likewise be cast as a π-SGD approximation of k-ary Janossy pooling. The authors name the permutation-sampling training procedure π-SGD and argue that it explains the puzzling success of feeding randomly permuted sequences to LSTMs in relational models. On the arithmetic tasks, LSTMs and GRUs trained with π-SGD typically achieved top performance or came within confidence intervals of it, for any choice of ρ.

The traced member is the 2-ary feedforward model from the arithmetic experiments, where the sum task predicts the sum of a sequence of 5 integers drawn from 0 to 99. In the paper, the k = 2 and k = 3 models use a feedforward network with a single hidden layer of 30 neurons as the permutation-sensitive function. Inference is itself stochastic for the full model: at test time the paper estimates the average with 1 and 20 sampled permutations. The authors' code targets PyTorch 0.4.0 or later.

Key idea. Janossy pooling expresses a permutation-invariant function as the average of a permutation-sensitive function over all reorderings of the input, with canonical orderings, k-ary dependencies and permutation sampling (π-SGD) as tractable approximations.

  • Janossy pooling
  • Janossy
  • permutation invariant
  • set function
  • multiset
  • DeepSets
  • pi-SGD
  • k-ary pooling
  • Janossy GraphSAGE
  • pooling layer

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{murphy2019janossypoolinglearningdeep,
      title={Janossy Pooling: Learning Deep Permutation-Invariant Functions for Variable-Size Inputs}, 
      author={Ryan L. Murphy and Balasubramaniam Srinivasan and Vinayak Rao and Bruno Ribeiro},
      year={2019},
      eprint={1811.01900},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1811.01900}, 
}