Skip to content

Solving CartPole-v1 environment in Keras with Actor Critic algorithm an Deep Reinforcement Learning algorithm

Notifications You must be signed in to change notification settings

nitish-kalan/CartPole-v1-Actor-Critic-Keras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CartPole-v1 Actor Critic in Keras

CartPole-v1 is an environment presented by OpenAI Gym. In this repository we have implemented Actor Critic algorithm [1] in Keras for building an agent to solve this CartPole-v1 enviroment.

Commands to run

  • To train the model

    python train_model.py
    
  • To test the model

    python test_model.py 'path_of_saved_model_weights' (without quotes)
    
  • To test agent with our trained weights

    python test_model.py saved_model/475.0.h5
    

Results

  • Output of agent taking random actions

    Episode: 0

  • Output of our agent at Episode: 100 with score 475.0

    Episode: 100, Score:475.0

References

[1] Actor-Critic Algorithms Authors: Vijay R. Konda John N. Tsitsiklis Link: https://papers.nips.cc/paper/1786-actor-critic-algorithms.pdf