#100100th of 120 in ML frameworks and libraries
sonnet
Module-based neural network library on top of TensorFlow 2
- Stars
- 10k
- License
- Apache-2.0
- Last commit
- Oct 2026
- Last release
- Jan 2024
- Language
- Python
9,875 on 2 Apr 20269,976 on 22 Oct 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
Sonnet is a DeepMind library that provides a single abstraction, snt.Module, for building neural networks in TensorFlow 2. It ships predefined modules such as Linear, Conv2D, BatchNorm and nets.MLP, and deliberately includes no training framework. Serialization goes through TensorFlow checkpoints and SavedModel, and distributed training uses TensorFlow distribution strategies.
Who it is for: ML researchers building custom neural networks in TensorFlow 2
Strengths
- Small API centered on one concept, snt.Module, with parameters created on first call
- Modules work with tf.train.Checkpoint and tf.saved_model without extra glue
- Behaves identically under distribution strategies; gradient reduction is left to the user
- Colab examples for MNIST MLP, GAN and multi-GPU CIFAR-10
Weaknesses
- Requires TensorFlow 2; no other backend is mentioned in the README
- No built-in training loop, so users write their own optimizer and training code
- Last release was 2024-01-02, despite recent commits
- Distributed training needs manual gradient all-reduce or distribution-aware modules
What it needs
- GPU optional
- Needs tensorflow, tensorflow-probability
- Models: TensorFlow checkpoints, TensorFlow SavedModel, pickle
Quick answers
Is sonnet open source?
Yes. Its code is on GitHub under the Apache-2.0 license.
Does sonnet need a GPU?
No. It runs on a CPU and can use a GPU when you have one.
Also in ML frameworks and libraries
See all 120| Rank | Project | Score |
|---|---|---|
| 1 | pytorchPython tensor library with GPU support and tape-based autograd for deep learning | 95 out of 100 |
| 2 | transformersPython library defining open models for text, vision, audio and multimodal tasks | 94 out of 100 |
| 3 | ultralyticsPython library and CLI for training and running YOLO vision models | 93 out of 100 |
| #4 | pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts | 93 out of 100 |
| #5 | supervisionPython toolkit for loading, annotating and counting computer vision detections | 91 out of 100 |