This repository contains implementations of various reinforcement learning algorithms, designed to help you explore, learn, and apply these algorithms to solve complex AI and machine learning problems. The project is organized into multiple folders, each focusing on a specific algorithm or method.
-
Q-Learning Algorithm
This folder contains a basic implementation of the Q-Learning algorithm, which is a model-free, off-policy RL method. The Q-Learning algorithm learns the optimal action-value function by iteratively updating the Q-values using the Bellman equation. It's effective for problems with discrete state and action spaces.- Key Features:
- Simple tabular Q-Learning implementation.
- Learning rate and discount factor tuning.
- Exploration vs. exploitation strategies (ε-greedy, decaying epsilon).
- Example environment for testing (like OpenAI Gym environments).
- Key Features:
-
Deep Q-Learning Algorithm (DQN)
This folder includes a Deep Q-Network implementation, which extends Q-Learning to environments with large or continuous state spaces by using neural networks to approximate the Q-value function. DQN is useful for solving more complex tasks where traditional Q-Learning fails due to the curse of dimensionality.- Key Features:
- DQN with experience replay and target network stabilization.
- Neural network architecture for Q-value approximation.
- Tunable hyperparameters (network layers, learning rate, batch size).
- Example implementation using environments like CartPole or Atari.
- Key Features:
-
Q-Learning with Genetic Algorithm (QGA)
This folder contains a hybrid approach combining Q-Learning with a Genetic Algorithm (GA). Here, the Q-values are optimized using genetic search methods, allowing the agent to learn efficiently in environments where the action or state space is too large for traditional Q-Learning methods.- Key Features:
- GA for optimizing Q-values over generations.
- Fitness function based on cumulative reward.
- Selection, crossover, and mutation operations.
- Example environment showing the performance improvement over basic Q-Learning.
- Key Features:
-
Policy Gradient Methods (Coming Soon)
In this folder, policy gradient algorithms like REINFORCE, Proximal Policy Optimization (PPO), and Actor-Critic methods will be implemented. These methods are particularly useful for problems with continuous action spaces and for directly learning optimal policies instead of action-value functions.- Key Features (Planned):
- REINFORCE algorithm with baseline.
- Actor-Critic architecture with shared or separate networks.
- PPO with clipped objective for stability.
- Continuous and discrete action space examples.
- Key Features (Planned):
To get started with any of these algorithms, simply navigate to the respective folder and follow the instructions in the README.md
file inside each folder.
git clone https://github.com/Faycal214/RL-algorithms.git
cd reinforcement-learning-algorithms
pip install -r requirements.txt