From 2ad949c9a22905c4c3cda3f744804e1c4e4bc6f6 Mon Sep 17 00:00:00 2001 From: Dylan Wilson Date: Thu, 1 Jun 2023 16:48:24 -0400 Subject: [PATCH] fix typos in Tianshou tutorial --- docs/tutorials/tianshou/beginner.md | 2 +- docs/tutorials/tianshou/intermediate.md | 2 +- tutorials/Tianshou/2_training_agents.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/tianshou/beginner.md b/docs/tutorials/tianshou/beginner.md index 64bca102e..0b994eba3 100644 --- a/docs/tutorials/tianshou/beginner.md +++ b/docs/tutorials/tianshou/beginner.md @@ -16,7 +16,7 @@ To follow this tutorial, you will need to install the dependencies shown below. ``` ## Code -The following code should run without any issues. The comments are designed to help you understand how to use PettingZoo with CleanRL. If you have any questions, please feel free to ask in the [Discord server](https://discord.gg/nhvKkYa6qX). +The following code should run without any issues. The comments are designed to help you understand how to use PettingZoo with Tianshou. If you have any questions, please feel free to ask in the [Discord server](https://discord.gg/nhvKkYa6qX). ```{eval-rst} .. literalinclude:: ../../../tutorials/Tianshou/1_basic_api_usage.py :language: python diff --git a/docs/tutorials/tianshou/intermediate.md b/docs/tutorials/tianshou/intermediate.md index 4618a42ed..8fc78cd20 100644 --- a/docs/tutorials/tianshou/intermediate.md +++ b/docs/tutorials/tianshou/intermediate.md @@ -4,7 +4,7 @@ title: "Tianshou: Training Agents" # Tianshou: Training Agents -This tutorial shows how use [Tianshou](https://github.com/thu-ml/tianshou) to train a [Deep Q-Network](https://tianshou.readthedocs.io/en/master/tutorials/dqn.html) (DQN) agent to play vs a [random policy](https://tianshou.readthedocs.io/en/master/_modules/tianshou/policy/random.html) agent in the [Tic-Tac-Toe](https://pettingzoo.farama.org/environments/classic/tictactoe/) environment. +This tutorial shows how to use [Tianshou](https://github.com/thu-ml/tianshou) to train a [Deep Q-Network](https://tianshou.readthedocs.io/en/master/tutorials/dqn.html) (DQN) agent to play vs a [random policy](https://tianshou.readthedocs.io/en/master/_modules/tianshou/policy/random.html) agent in the [Tic-Tac-Toe](https://pettingzoo.farama.org/environments/classic/tictactoe/) environment. ## Environment Setup To follow this tutorial, you will need to install the dependencies shown below. It is recommended to use a newly-created virtual environment to avoid dependency conflicts. diff --git a/tutorials/Tianshou/2_training_agents.py b/tutorials/Tianshou/2_training_agents.py index 6ab67a212..3f4a1e8fd 100644 --- a/tutorials/Tianshou/2_training_agents.py +++ b/tutorials/Tianshou/2_training_agents.py @@ -95,8 +95,8 @@ def _get_env(): # ======== Step 4: Callback functions setup ========= def save_best_fn(policy): - model_save_path = os.path.join("log", "rps", "dqn", "policy.pth") - os.makedirs(os.path.join("log", "rps", "dqn"), exist_ok=True) + model_save_path = os.path.join("log", "ttt", "dqn", "policy.pth") + os.makedirs(os.path.join("log", "ttt", "dqn"), exist_ok=True) torch.save(policy.policies[agents[1]].state_dict(), model_save_path) def stop_fn(mean_rewards):