Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargi Vaidya committed Feb 13, 2021
1 parent 28eb3dc commit 6f79488
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parrot_training.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Benchmark reinforcement learning (RL) algorithms from Stable Baselines 2.10.
Author: Gargi Vaidya & Vishnu Saj
- Note : Modify the RL algorithm from StableBaselines and tune the hyperparameters.
- Note : Modify the RL algorithm from StableBaselines and tune the hyperparameters for best reward performance.
"""
import olympe
Expand Down Expand Up @@ -74,6 +74,7 @@ def _on_step(self) -> bool:
self.model.save(self.save_path)

return True

# Stores a csv file for the episode reward
heading = ["Timestep", "Reward"]
with open('reward.csv', 'w', newline='') as csvFile:
Expand All @@ -89,6 +90,7 @@ def _on_step(self) -> bool:
#env.reset()
env = Monitor(env, log_dir)

# Train the RL algorithm
model = TD3(MlpPolicy, env, verbose=1, learning_rate = 0.0005,tensorboard_log="./td3_parrot_tensorboard/", buffer_size = 25000)
callback = SaveOnBestTrainingRewardCallback(check_freq=1000, log_dir=log_dir)
model.learn(total_timesteps=30000, log_interval=10,tb_log_name = "td3_run_3d", callback = callback)
Expand Down

0 comments on commit 6f79488

Please sign in to comment.