Giter Club home page Giter Club logo

ddpg's Introduction

DDPG

  • Implimenting DDPG Algorithm in Tensorflow-2.0
  • Tested on Open-AI Pendulum-v0 and Continous mountain car gym environments.
  • DDPG - algorthim
  • Python package

Install :

  • pip install DDPG-TF

python code:

import gym

from ddpg import DDPG

env = gym.make('Pendulum-v0')

ddpg = DDPG(     env , # Gym environment with continous action space
                 actor(None), # Tensorflow/keras model
                 critic (None), # Tensorflow/keras model
                 buffer (None), # pre-recorded buffer
                 action_bound_range=1,
                 max_buffer_size =10000, # maximum transitions to be stored in buffer
                 batch_size =64, # batch size for training actor and critic networks
                 max_time_steps = 1000 ,# no of time steps per epoch
                 tow = 0.001, # for soft target update
                 discount_factor  = 0.99,
                 explore_time = 1000, # time steps for random actions for exploration
                 actor_learning_rate = 0.0001,
                 critic_learning_rate = 0.001
                 dtype = 'float32',
                 n_episodes = 1000 ,# no of episodes to run
                 reward_plot = True ,# (bool)  to plot reward progress per episode
                 model_save = 1, # epochs to save models and buffer
                 plot = False, # Plot rewards for every episode
                 model_save_freq = 10) #no.of episodes to save state of model

ddpg.train() 

Results :

  • On pendulum problem explored for 5 episodes

Reward plot of Pendulum problem

  • On Continous mountain car problem explored for 100 episodes

Reward plot of CountinousMountain car

ddpg's People

Contributors

dekki-aero avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.