DDPG
- Implimenting DDPG Algorithm in Tensorflow-2.0
- Tested on Open-AI Pendulum-v0 and Continous mountain car gym environments.
- DDPG - algorthim : https://arxiv.org/abs/1509.02971
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
ddpg.train()
Results :
- On pendulum problem explored for 5 episodes
- On Continous mountain car problem explored for 100 episodes
Metadata
Release files for DDPG-TF 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| DDPG-TF-2.0.3.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| DDPG_TF-2.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / DDPG-TF-2.0.3.tar.gz
| Download URL | DDPG-TF-2.0.3.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc55e3b96bc6619ab3cd80a2f4c8ae61349bf1e8bd32f85d08e75ebfc1791c41
|
|
BLAKE2b-256 checksum How to use checksums |
685a00c19b0d674729fb605c87b98c66b92c85686614c3484010ba0c4e32a882
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8
|
Release files / DDPG_TF-2.0.3-py3-none-any.whl
| Download URL | DDPG_TF-2.0.3-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd45af53271b1cf9401c4322f72253012636efad885bda6665481c923a3087fe
|
|
BLAKE2b-256 checksum How to use checksums |
ce0f6ef8856e8e97fa5e7d972a773569e70f26cb6868912cb0a12372f40afed6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8
|