Downloads · 30 days
0
kirubel1738/cartpole-dqn
cartpole-dqn is a reinforcement learning model from kirubel1738. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
This repository contains a trained Deep Q-Network (DQN) agent for the Gymnasium environment CartPole-v1.
Downloads · 30 days
0
Access
Public
Updated Feb 24, 2026
Repo size
210 KB
Likes
0
Public
Click a slice to open those files.
.gif138 KB · 64%
From the Hugging Face model README
This repository contains a trained Deep Q-Network (DQN) agent for the Gymnasium environment CartPole-v1.
CartPole has a continuous state space, making tabular Q-learning infeasible.
DQN approximates Q-values using a neural network:
Q(s,a; θ)
Training target:
y = r + γ max_a' Q(s',a'; θ⁻)
Key components:
Because CartPole has continuous states:
s ∈ ℝ⁴
A Q-table cannot represent infinite possible states.
A neural network is used for function approximation.
Replay buffer improves stability and data efficiency.
The agent learns to consistently balance the pole for long durations.
Training reward improves steadily over episodes.
Below is the trained DQN agent:

cartpole_dqn.pt → Trained PyTorch modelcartpole_dqn.gif → Agent demonstrationThis project demonstrates:
It represents a transition from tabular RL to deep RL.