All models

HyperNetwork-static

One small network writes the weights of another: static layer embeddings for convnets, a HyperLSTM for recurrent nets.

21 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 (22 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
12.9K
Operations
21
Framework
PyTorch
Recurrent
No
Published
2016
Cited by
1,590 (as of 29 November 2026)
Authors
David Ha, Andrew Dai, Quoc V. Le
License
GPL-3.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
m1393
Graph hash
f7a118b556e3a514389378b2aed72d9fd42ebcc88fb4dd619e802cd8980ae473
Skeleton hash
bcedaa1f51e7b17d84d38e536a1fe25862c6a106b9cb7ff6e0297d78604e48cf
Architecture hash
9486f1a3db057d53effa5831843237adaf06cb7af1fca9ca4c35ec7711beba3a
Diagram SHA-256
95327480fe9fe9fc3dbd6b9277aa3909b0f6c251da876753580a8e4793fc91da
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

This is the static hypernetwork: for each layer j the hypernetwork receives a layer embedding z_j as input and predicts that layer's convolution kernel K_j, through a two-layer linear network.

About this model's family

A hypernetwork is one network used to generate the weights for another network. The authors frame it with an analogy from nature, the relationship between a genotype, the hypernetwork, and a phenotype, the main network, and note that while hypernetworks are reminiscent of HyperNEAT in evolution, theirs are trained end-to-end with backpropagation and are usually faster. The main network behaves like any usual neural network, mapping raw inputs to targets, whereas the hypernetwork takes a set of inputs that describe the structure of the weights and generates the weight for that layer.

The paper treats convolutional networks and recurrent networks as two ends of a spectrum, with recurrent networks imposing weight-sharing across layers and convolutional networks enjoying the flexibility of no weight-sharing at the cost of redundant parameters when deep. Hypernetworks are a form of relaxed weight-sharing that strikes a balance between the two ends. In the static form, aimed at deep convolutional networks, the hypernetwork receives a layer embedding z_j for each layer j and predicts that layer's kernel matrix K_j. In the dynamic form, a recurrent network generates weights for another recurrent network so that the weights can vary across many timesteps, and for memory's sake the practical version only scales the rows of a weight matrix by a weight scaling vector rather than building the whole matrix from scratch.

The headline result is that hypernetworks can generate non-shared weights for LSTM and reach near state-of-the-art results on character-level language modelling, handwriting generation and neural machine translation, challenging the weight-sharing paradigm for recurrent networks. Applied to convolutional networks they still achieve respectable image recognition results compared to state-of-the-art baselines while requiring fewer learnable parameters; on CIFAR-10 the relaxed weight sharing cost about 1.25 to 1.5% in classification accuracy while drastically reducing the number of parameters. The captured members cover the static convolution-kernel generator, the dynamic HyperLSTM, a PyTorch HyperNetworks-for-ResNet implementation, and a generic MLP hypernetwork that emits flattened target weights.

Key idea. HyperNetworks showed that a small network can generate non-shared, per-step weights for an LSTM and reach near state-of-the-art sequence modelling results, which challenged the weight-sharing paradigm for recurrent networks.

  • HyperNetworks
  • hypernetwork
  • hyper network
  • HyperLSTM
  • HyperRNN
  • static hypernetwork
  • dynamic hypernetwork
  • weight generation
  • Ha Dai Le
  • genotype phenotype
  • relaxed weight sharing
  • Hyper Residual Network

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

Cite the paper

@misc{ha2016hypernetworks,
      title={HyperNetworks}, 
      author={David Ha and Andrew Dai and Quoc V. Le},
      year={2016},
      eprint={1609.09106},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1609.09106}, 
}