forked from DLR-RM/stable-baselines3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update SB3 Contrib doc (ARS) and W&B integration (DLR-RM#726)
* Add ARS to SB3 contrib * Add integration page
- Loading branch information
Showing
6 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.. _integrations: | ||
|
||
============ | ||
Integrations | ||
============ | ||
|
||
Weights & Biases | ||
================ | ||
|
||
Weights & Biases provides a callback for experiment tracking that allows to visualize and share results. | ||
|
||
The full documentation is available here: https://docs.wandb.ai/guides/integrations/other/stable-baselines-3 | ||
|
||
.. code-block:: python | ||
import gym | ||
import wandb | ||
from wandb.integration.sb3 import WandbCallback | ||
from stable_baselines3 import PPO | ||
config = { | ||
"policy_type": "MlpPolicy", | ||
"total_timesteps": 25000, | ||
"env_name": "CartPole-v1", | ||
} | ||
run = wandb.init( | ||
project="sb3", | ||
config=config, | ||
sync_tensorboard=True, # auto-upload sb3's tensorboard metrics | ||
# monitor_gym=True, # auto-upload the videos of agents playing the game | ||
# save_code=True, # optional | ||
) | ||
model = PPO(config["policy_type"], config["env_name"], verbose=1, tensorboard_log=f"runs/{run.id}") | ||
model.learn( | ||
total_timesteps=config["total_timesteps"], | ||
callback=WandbCallback( | ||
model_save_path=f"models/{run.id}", | ||
verbose=2, | ||
), | ||
) | ||
run.finish() | ||
Hugging Face | ||
============ | ||
|
||
To be added. |
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
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
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