From c752e175cc1d8efed85dbd592fa252dd0b703656 Mon Sep 17 00:00:00 2001 From: Jiayi Zhou <108712610+Gaiejj@users.noreply.github.com> Date: Fri, 25 Aug 2023 04:56:59 +0800 Subject: [PATCH] docs: refine README.md --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 287a3d2..cfdd081 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Firstly, each algorithm is implemented strictly according to the original paper - [Overview of Algorithms](#overview-of-algorithms) - [Supported Environments: Safety-Gymnasium](#supported-environments-safety-gymnasium) - - [Isaac Gym-based Environments](#isaac-gym-based-environments) - [Selected Tasks](#selected-tasks) - [Pre-requisites](#pre-requisites) - [Conda-Environment](#conda-environment) @@ -153,6 +152,8 @@ For more details, please refer to [Safety-Gymnasium](https://github.com/PKU-Alig - **❗️As Safe MultiGoal and Safe Isaac Gym tasks have not been uploaded in PyPI due to too large package size, please install [Safety-Gymnasium](https://github.com/PKU-Alignment/safety-gymnasium) manually to run those two tasks, by using following commands:** ```bash +conda create -n safe python=3.8 +conda activate safe wget https://github.com/PKU-Alignment/safety-gymnasium/archive/refs/heads/main.zip unzip main.zip cd safety-gymnasium-main @@ -188,7 +189,7 @@ pip install -e . ### Efficient Commands -To verify the performance of SafePO, you can run the following one line: +To verify the performance of SafePO, you can run the following: ```bash conda create -n safepo python=3.8 @@ -204,9 +205,20 @@ conda activate safepo make simple-benchmark ``` -This command will run all algorithms in sampled environments to get +These commands will run all algorithms in sampled environments to get a quick overview of the performance of the algorithms. +**Please notice that these commands would reinstall Safety-Gymnasium from PyPI. +To run Safe Isaac Gym and Safe Multi Goal, please reinstall it manully from source by:** + +```bash +conda activate safe +wget https://github.com/PKU-Alignment/safety-gymnasium/archive/refs/heads/main.zip +unzip main.zip +cd safety-gymnasium-main +pip install -e . +``` + ### Single-Agent Each algorithm file is the entrance. Running `ALGO.py` with arguments about algorithms and environments does the training. For example, to run PPO-Lag in SafetyPointGoal1-v0 with seed 0, you can use the following command: @@ -216,14 +228,14 @@ cd safepo/single_agent python ppo_lag.py --task SafetyPointGoal1-v0 --seed 0 ``` -To run a benchmark parallelly, for example, you can use the following command to run `PPO-Lag`, `TRPO-Lag` in `SafetyAntVelocity-v1`, `SafetyHalfCheetahVelocity-v1`: +To run a benchmark parallelly, for example, you can use the following commands to run `PPO-Lag`, `TRPO-Lag` in `SafetyAntVelocity-v1`, `SafetyHalfCheetahVelocity-v1`: ```bash cd safepo/single_agent python benchmark.py --tasks SafetyAntVelocity-v1 SafetyHalfCheetahVelocity-v1 --algo ppo_lag trpo_lag --workers 2 ``` -The command above will run two processes in parallel, each process will run one algorithm in one environment. The results will be saved in `./runs/`. +Commands above will run two processes in parallel, each process will run one algorithm in one environment. The results will be saved in `./runs/`. ### Multi-Agent