import gym
from ddpg importDDPG
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 bufferaction_bound_range=1,
max_buffer_size=10000, # maximum transitions to be stored in bufferbatch_size=64, # batch size for training actor and critic networksmax_time_steps=1000 ,# no of time steps per epochtow=0.001, # for soft target updatediscount_factor=0.99,
explore_time=1000, # time steps for random actions for explorationactor_learning_rate=0.0001,
critic_learning_rate=0.001dtype='float32',
n_episodes=1000 ,# no of episodes to runreward_plot=True ,# (bool) to plot reward progress per episodemodel_save=1, # epochs to save models and bufferplot=False, # Plot rewards for every episodemodel_save_freq=10) #no.of episodes to save state of model
ddpg.train()
Results :
On pendulum problem explored for 5 episodes
On Continous mountain car problem explored for 100 episodes
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.