#7070th of 75 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+105
31 Mar 2026: 9,872 stars7 Apr 2026: 9,880 stars14 Apr 2026: 9,883 stars21 Apr 2026: 9,885 stars28 Apr 2026: 9,886 stars5 May 2026: 9,887 stars12 May 2026: 9,888 stars19 May 2026: 9,889 stars26 May 2026: 9,892 stars2 Jun 2026: 9,897 stars9 Jun 2026: 9,900 stars16 Jun 2026: 9,901 stars23 Jun 2026: 9,904 stars30 Jun 2026: 9,904 stars7 Jul 2026: 9,922 stars14 Jul 2026: 9,924 stars21 Jul 2026: 9,928 stars28 Jul 2026: 9,931 stars4 Aug 2026: 9,932 stars11 Aug 2026: 9,933 stars18 Aug 2026: 9,949 stars25 Aug 2026: 9,955 stars1 Sept 2026: 9,959 stars8 Sept 2026: 9,963 stars15 Sept 2026: 9,966 stars22 Sept 2026: 9,967 stars29 Sept 2026: 9,969 stars6 Oct 2026: 9,970 stars13 Oct 2026: 9,973 stars20 Oct 2026: 9,977 stars

9,872 on 31 Mar 20269,977 on 20 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

Also in ML frameworks and libraries

See all 75
Also in ML frameworks and libraries
RankProjectScore
1transformersPython library defining open models for text, vision, audio and multimodal tasks167.9k starsApache-2.094 out of 100
2pytorchPython tensor library with GPU support and tape-based autograd for deep learning104.9k starscustom license94 out of 100
3ultralyticsPython library and CLI for training and running YOLO vision models62.7k starsAGPL-3.092 out of 100
#4pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts37.2k starsApache-2.091 out of 100
#5supervisionPython toolkit for loading, annotating and counting computer vision detections Live demo ↗ (opens in a new tab)51.3k starsMIT90 out of 100