#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
Stars, last 29 weeks+101
2 Apr 2026: 9,875 stars9 Apr 2026: 9,880 stars16 Apr 2026: 9,883 stars23 Apr 2026: 9,885 stars30 Apr 2026: 9,886 stars7 May 2026: 9,887 stars14 May 2026: 9,887 stars21 May 2026: 9,889 stars28 May 2026: 9,892 stars4 Jun 2026: 9,897 stars11 Jun 2026: 9,899 stars18 Jun 2026: 9,901 stars25 Jun 2026: 9,903 stars2 Jul 2026: 9,904 stars9 Jul 2026: 9,922 stars16 Jul 2026: 9,924 stars23 Jul 2026: 9,928 stars30 Jul 2026: 9,930 stars6 Aug 2026: 9,932 stars13 Aug 2026: 9,933 stars20 Aug 2026: 9,952 stars27 Aug 2026: 9,955 stars3 Sept 2026: 9,961 stars10 Sept 2026: 9,963 stars17 Sept 2026: 9,965 stars24 Sept 2026: 9,966 stars1 Oct 2026: 9,969 stars8 Oct 2026: 9,969 stars15 Oct 2026: 9,973 stars22 Oct 2026: 9,976 stars

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
Also in ML frameworks and libraries
RankProjectScore
1pytorchPython tensor library with GPU support and tape-based autograd for deep learning105k starscustom license95 out of 100
2transformersPython library defining open models for text, vision, audio and multimodal tasks168.1k starsApache-2.094 out of 100
3ultralyticsPython library and CLI for training and running YOLO vision models62.8k starsAGPL-3.093 out of 100
#4pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts37.2k starsApache-2.093 out of 100
#5supervisionPython toolkit for loading, annotating and counting computer vision detections Live demo ↗ (opens in a new tab)51.3k starsMIT91 out of 100