#400400th of 433 in ML frameworks and libraries

keras-attention

Keras attention layer with Luong and Bahdanau score functions

Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.

Stars
2.8k
License
Apache-2.0
Last commit
Mar 2026
Last release
Mar 2023
Language
Python
Stars, last 30 weeks+4
2 May 2026: 2,805 stars9 May 2026: 2,805 stars16 May 2026: 2,805 stars23 May 2026: 2,805 stars30 May 2026: 2,805 stars6 Jun 2026: 2,805 stars13 Jun 2026: 2,805 stars20 Jun 2026: 2,805 stars27 Jun 2026: 2,805 stars4 Jul 2026: 2,805 stars11 Jul 2026: 2,805 stars18 Jul 2026: 2,805 stars25 Jul 2026: 2,805 stars1 Aug 2026: 2,806 stars8 Aug 2026: 2,806 stars15 Aug 2026: 2,806 stars22 Aug 2026: 2,806 stars29 Aug 2026: 2,807 stars5 Sept 2026: 2,807 stars12 Sept 2026: 2,807 stars19 Sept 2026: 2,807 stars26 Sept 2026: 2,807 stars3 Oct 2026: 2,807 stars10 Oct 2026: 2,808 stars17 Oct 2026: 2,808 stars24 Oct 2026: 2,809 stars31 Oct 2026: 2,809 stars7 Nov 2026: 2,809 stars14 Nov 2026: 2,809 stars21 Nov 2026: 2,809 stars28 Nov 2026: 2,809 stars

2,805 on 2 May 20262,809 on 28 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

A PyPI package (`attention`) that adds a single Attention layer to Keras models on TensorFlow 2.x. It takes a 3D tensor (batch, timesteps, input_dim), such as LSTM output, and returns a 2D attention vector, with a choice of Luong multiplicative or Bahdanau additive scoring. The README includes an IMDB comparison and toy examples that visualize attention weights.

Who it is for: Keras/TensorFlow users adding attention to RNN sequence models

Strengths

  • Drop-in Keras layer: Attention(units=32, score='luong') after an RNN layer
  • Supports both Luong and Bahdanau score functions
  • Examples visualize attention weights on toy tasks (add two numbers, find max)
  • Tested against TensorFlow 2.8 through 2.14

Weaknesses

  • Last tested TensorFlow version is 2.14 (Sep 2023); newer versions not listed
  • Last release was March 2023
  • Returns a pooled 2D vector, not a sequence, limiting seq2seq decoder use
  • Only two score functions; no multi-head or transformer-style attention

What it needs

  • GPU optional
  • Needs TensorFlow 2.0+, Keras

What changed

From the release notes. No flag means the note does not say so, not that the upgrade is safe. Releases and problems by RSS

Also in ML frameworks and libraries

See all 433
Also in ML frameworks and libraries
RankProjectScore
#398dit-extrapolationPlug-in RoPE changes for longer video and higher-resolution image generation in DiTs833 starsApache-2.021 out of 100
#399videopipeC++ pipeline framework for video analysis with pluggable inference nodes3k starsApache-2.020 out of 100
#401pycmPython library for multi-class confusion matrices and classifier metrics1.5k starsMIT20 out of 100
#402internnavToolbox for training and evaluating embodied navigation models in Habitat and Isaac Sim Live demo ↗ (opens in a new tab)1.2k starsMIT20 out of 100
#403deimTraining framework for real-time DETR object detectors with faster convergence1.7k starscustom license19 out of 100