Sonnet

Build neural networks and support machine learning research with Sonnet, a library based on TensorFlow.

github.com/deepmind/sonnet
Sonnet homepage screenshot

About Sonnet

Sonnet is a library built on TensorFlow 2 for machine learning research. It organizes code around snt.Module, which can hold parameters, other modules, and methods that process input. It includes predefined modules such as snt.Linear, snt.Conv2D, and snt.BatchNorm, plus networks such as snt.nets.MLP, and supports custom modules by subclassing snt.Module.

Sonnet does not include a training framework, so users build their own or use one built by others. Installation uses pip as dm-sonnet alongside TensorFlow 2.0 and tensorflow-probability.

Key features

  • Provides snt.Module abstraction for parameters and nested modules
  • Includes predefined layers such as Linear, Conv2D, and BatchNorm
  • Includes predefined networks such as snt.nets.MLP
  • Supports custom modules by subclassing snt.Module
  • Exposes variables and trainable_variables for use with optimizers
  • Supports distributed training with snt.distribute
Best for: Researchers building custom neural networks with TensorFlow 2 for supervised, unsupervised, or reinforcement learning.
Good for
  • Modules are self-contained and decoupled from one another
  • Explains reasons for defaults such as initial parameter values
  • Includes examples for MLP prediction, GAN training, and distributed training
Watch out for
  • Does not ship with a training framework; users build or adopt their own

Sonnet at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 6, 2026 · Online when checked
Listed
Oct 5, 2026

Sonnet alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in AI Infrastructure & MLOps

Well-known listings from the same topic.

All 341

Sonnet FAQ

How do I install Sonnet?
Install TensorFlow 2.0 with pip install tensorflow tensorflow-probability, then pip install dm-sonnet.
Does Sonnet include a training framework?
No. Users are encouraged to build their own training code or adopt one built by others.
How do I create a custom layer?
Subclass snt.Module and define initialization and computation in the subclass.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing