1. What is Reinforcement Learning?
Reinforcement Learning (RL) is a machine learning approach where an agent learns by interacting with an environment. The agent:- Observes the current state.
- Selects an action.
- Receives a reward.
- Learns from the result.
- Repeats the process.
2. CartPole Environment
CartPole is a simple reinforcement learning environment. The goal is to keep a pole balanced on top of a moving cart.3. OpenAI Gym / Gymnasium
Gym provides environments that can be used to test reinforcement learning algorithms. The modern package is Gymnasium. Install it:4. State
The state describes the current condition of the CartPole environment. CartPole has 4 state values:5. Action
CartPole has two possible actions:6. Reward
A reward is feedback from the environment. For CartPole, the agent receives a reward for keeping the pole balanced. Example:7. What is DQN?
DQN stands for: Deep Q-Network DQN combines:8. Q-Values
A Q-value represents how useful an action is for the current state. Example:9. DQN Architecture
The simple model used inrl_demo.py is:
2 represents the two possible actions.