This repository contains the code for training and using a Deep Q-Network (DQN) agent to solve a reinforcement learning task using the OpenAI Gym environment.
In this project, we train a DQN agent to learn and perform tasks in the OpenAI Gym environment. The trained DQN agent is saved as a Keras model and can be loaded for evaluation or further use.
drl.ipynb
: Jupyter Notebook for training the DQN agent.cartpole.h5
: Saved DQN agent model.test.ipynb
: Jupyter Notebook for evaluating the DQN agent in the environment.requirements.txt
: List of Python dependencies required to run the code.
- Install the required dependencies by running:
pip install -r requirements.txt
- Train the DQN agent in drl.ipynb
This script will train the DQN agent in the specified environment and save the trained model as cartpole.h5
.
- Evaluate the DQN agent
This script will load the trained DQN agent and run it in the environment to evaluate its performance.
- Python 3.x
- TensorFlow (compatible with your TensorFlow version)
- OpenAI Gym
- NumPy
- Pygame (for visualization, if applicable)
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI Gym: The Gym library provides various reinforcement learning environments.
- Keras-RL: A high-level library for reinforcement learning in Keras.