View rl20.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rllib rollout \ | |
tmp/ppo/cart/checkpoint_40/checkpoint-40 \ | |
- config "{\"env\": \"CartPole-v1\"}" \ | |
- run PPO \ | |
- steps 2000 |
View rl19.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__________________________________________________________________________________________________ | |
Layer (type) Output Shape Param # Connected to | |
================================================================================================== | |
observations (InputLayer) [(None, 4)] 0 | |
__________________________________________________________________________________________________ | |
fc_1 (Dense) (None, 256) 1280 observations[0][0] | |
__________________________________________________________________________________________________ | |
fc_value_1 (Dense) (None, 256) 1280 observations[0][0] | |
__________________________________________________________________________________________________ | |
fc_2 (Dense) (None, 256) 65792 fc_1[0][0] |
View rl18.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N_ITER = 40 | |
s = "{:3d} reward {:6.2f}/{:6.2f}/{:6.2f} len {:6.2f} saved {}" | |
for n in range(N_ITER): | |
result = agent.train() | |
file_name = agent.save(CHECKPOINT_ROOT) | |
print(s.format( | |
n + 1, | |
result["episode_reward_min"], |
View rl17.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT_ENV = "CartPole-v1" | |
config = ppo.DEFAULT_CONFIG.copy() | |
config["log_level"] = "WARN" | |
agent = ppo.PPOTrainer(config, env=SELECT_ENV) |
View rl16.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHECKPOINT_ROOT = "tmp/ppo/cart" | |
shutil.rmtree(CHECKPOINT_ROOT, ignore_errors=True, onerror=None) | |
ray_results = os.getenv("HOME") + "/ray_results/" | |
shutil.rmtree(ray_results, ignore_errors=True, onerror=None) |
View rl15.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rllib rollout \ | |
tmp/ppo/froz/checkpoint_10/checkpoint-10 \ | |
- config "{\"env\": \"FrozenLake-v0\"}" \ | |
- run PPO \ | |
- steps 2000 |
View rl14.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_____________________________________________________________________________ | |
Layer (type) Output Shape Param # Connected to | |
============================================================================= | |
observations (InputLayer) [(None, 16)] 0 | |
_____________________________________________________________________________ | |
fc_1 (Dense) (None, 256) 4352 observations[0][0] | |
_____________________________________________________________________________ | |
fc_value_1 (Dense) (None, 256) 4352 observations[0][0] | |
_____________________________________________________________________________ | |
fc_2 (Dense) (None, 256) 65792 fc_1[0][0] |
View rl13.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N_ITER = 10 | |
s = "{:3d} reward {:6.2f}/{:6.2f}/{:6.2f} len {:6.2f} saved {}" | |
for n in range(N_ITER): | |
result = agent.train() | |
file_name = agent.save(CHECKPOINT_ROOT) | |
print(s.format( | |
n + 1, | |
result["episode_reward_min"], |
View rl12.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT_ENV = "FrozenLake-v0" | |
config = ppo.DEFAULT_CONFIG.copy() | |
config["log_level"] = "WARN" | |
agent = ppo.PPOTrainer(config, env=SELECT_ENV) |
View rl11.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHECKPOINT_ROOT = "tmp/ppo/froz" | |
shutil.rmtree(CHECKPOINT_ROOT, ignore_errors=True, onerror=None) | |
ray_results = os.getenv("HOME") + "/ray_results/" | |
shutil.rmtree(ray_results, ignore_errors=True, onerror=None) |