Skip to content

krishnamanc/CartPoleSolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CartPoleSolution

Reinforcement Learning with DQN

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.

Overview

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.

Contents

  • 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.

Usage

  1. Install the required dependencies by running:

pip install -r requirements.txt

  1. 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.

  1. Evaluate the DQN agent

This script will load the trained DQN agent and run it in the environment to evaluate its performance.

Dependencies

  • Python 3.x
  • TensorFlow (compatible with your TensorFlow version)
  • OpenAI Gym
  • NumPy
  • Pygame (for visualization, if applicable)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • OpenAI Gym: The Gym library provides various reinforcement learning environments.
  • Keras-RL: A high-level library for reinforcement learning in Keras.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published