#153153rd of 171 in Learning and cookbooks

deep-q-learning

Minimal DQN and Double DQN agents in Keras and Gymnasium

Stars
1.3k
License
MIT
Last commit
May 2026
Language
Python
Stars, last 29 weeks+20
6 May 2026: 1,313 stars13 May 2026: 1,313 stars20 May 2026: 1,315 stars27 May 2026: 1,315 stars3 Jun 2026: 1,317 stars10 Jun 2026: 1,318 stars17 Jun 2026: 1,319 stars24 Jun 2026: 1,322 stars1 Jul 2026: 1,322 stars8 Jul 2026: 1,323 stars15 Jul 2026: 1,325 stars22 Jul 2026: 1,325 stars29 Jul 2026: 1,325 stars5 Aug 2026: 1,326 stars12 Aug 2026: 1,326 stars19 Aug 2026: 1,326 stars26 Aug 2026: 1,326 stars2 Sept 2026: 1,327 stars9 Sept 2026: 1,327 stars16 Sept 2026: 1,328 stars23 Sept 2026: 1,328 stars30 Sept 2026: 1,329 stars7 Oct 2026: 1,330 stars14 Oct 2026: 1,330 stars21 Oct 2026: 1,330 stars28 Oct 2026: 1,331 stars4 Nov 2026: 1,332 stars11 Nov 2026: 1,332 stars18 Nov 2026: 1,332 stars25 Nov 2026: 1,333 stars

1,313 on 6 May 20261,333 on 25 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Teaching implementation of Deep Q-Learning in under 100 lines, using Keras 3 and Gymnasium with a deque-bounded experience replay memory. It includes dqn.py, a batched variant (dqn_batch.py) and ddqn.py, which implements Double DQN with Huber loss. A blog article explains the dqn.py code.

Who it is for: Learners studying reinforcement learning through a small DQN example

Strengths

  • Core agent fits in under 100 lines, easy to read end to end
  • Accompanying blog article walks through dqn.py
  • Updated in 2026-05 to Keras 3 and Gymnasium
  • save() and load() persist weights and epsilon

Weaknesses

  • README says dqn.py training can be unstable; ddqn.py is the mitigation
  • Small scripts, not a reusable RL library
  • No release, tests or benchmark results mentioned
  • Double DQN article is described as upcoming and is not linked

What it needs

  • Needs Keras 3, Gymnasium

Also in Learning and cookbooks

See all 171
Also in Learning and cookbooks
RankProjectScore
#151machine-learning-specialization-courseraSolved notebooks for Andrew Ng's Coursera Machine Learning Specialization8.2k stars+102 (+1.3%) in 30 daysMIT23 out of 100
#152snakeSnake game player using graph search and a Double DQN agent1.8k starsMIT21 out of 100
#154ml-nlpChinese-language ML and NLP interview study notes with code examples17.8k starsno license19 out of 100
#155ai-engineering.academyStructured learning paths and notebooks for applied generative AI engineering2.4k starsMIT19 out of 100
#156musicinformationretrieval.comJupyter notebooks teaching music information retrieval with Python Live demo ↗ (opens in a new tab)1.3k starsMIT16 out of 100