improve simulator and ddpg

This commit is contained in:
yangdsh
2019-10-28 17:37:08 +00:00
committed by Dana Van Aken
parent 5431154784
commit 9f71d1c8de
4 changed files with 125 additions and 80 deletions

View File

@@ -80,4 +80,4 @@ DDPG_BATCH_SIZE = 32
ACTOR_LEARNING_RATE = 0.01
# Learning rate of critic network
CRITIC_LEARNING_RATE = 0.01
CRITIC_LEARNING_RATE = 0.001

View File

@@ -338,7 +338,8 @@ def train_ddpg(result_id):
if session.ddpg_reply_memory:
ddpg.replay_memory.set(session.ddpg_reply_memory)
ddpg.add_sample(normalized_metric_data, knob_data, reward, normalized_metric_data)
ddpg.update()
for _ in range(25):
ddpg.update()
session.ddpg_actor_model, session.ddpg_critic_model = ddpg.get_model()
session.ddpg_reply_memory = ddpg.replay_memory.get()
session.save()