From 17919d11aaa91a3ad87b74b1a5356cbc88ad0458 Mon Sep 17 00:00:00 2001 From: Claude Formanek Date: Fri, 8 Mar 2024 09:41:11 +0200 Subject: [PATCH 1/4] Added missing file and updated README. --- README.md | 2 +- examples/download_dataset.py | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index af0f60bd..b8c3908d 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Download environment dependencies. We will use SMACv1 in this example. Download a dataset. -`python examples/download_vault.py --env=smac_v1 --scenario=3m` +`python examples/download_dataset.py --env=smac_v1 --scenario=3m` Run a baseline. In this example we will run MAICQ. diff --git a/examples/download_dataset.py b/examples/download_dataset.py index 1331dcca..954f8971 100644 --- a/examples/download_dataset.py +++ b/examples/download_dataset.py @@ -11,21 +11,21 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from absl import app, flags -from og_marl.environments import smacv1 -from og_marl.offline_dataset import OfflineMARLDataset, download_and_unzip_dataset +from og_marl.offline_dataset import download_and_unzip_vault -# Comment this out if you already downloaded the dataset -download_and_unzip_dataset("smac_v1", "3m", dataset_base_dir="datasets") +FLAGS = flags.FLAGS +flags.DEFINE_string("env", "smac_v1", "Environment name.") +flags.DEFINE_string("scenario", "3m", "Environment scenario name.") -# Compute mean episode return of Good dataset -env = smacv1.SMACv1("3m") # Change SMAC Scenario Here -dataset = OfflineMARLDataset(env, "datasets/smac_v1/3m/Good") +def main(_): + # Download vault + download_and_unzip_vault(FLAGS.env_name, FLAGS.scenario_name) -sample_cnt = 0 -tot_returns = 0 -for sample in dataset._tf_dataset: - sample_cnt += 1 - tot_returns += sample["episode_return"].numpy() -print("Mean Episode return:", tot_returns / sample_cnt) + # NEXT STEPS: See `examples/dataset_api_demo.ipynb` + + +if __name__ == "__main__": + app.run(main) From 20bdd58947dccabfaa20df0d128236e0beb6bdce Mon Sep 17 00:00:00 2001 From: Claude Formanek Date: Fri, 8 Mar 2024 09:43:53 +0200 Subject: [PATCH 2/4] Remove dataset file structure from README. --- README.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/README.md b/README.md index b8c3908d..0ffa9e8c 100644 --- a/README.md +++ b/README.md @@ -136,19 +136,6 @@ vaults/ | |_> Medium/ | |_> Poor/ |_> ... -datasets/ - |_> smac_v1/ - |_> 3m/ - | |_> Good/ - | |_> Medium/ - | |_> Poor/ - |_> ... - |_> smac_v2/ - |_> terran_5_vs_5/ - | |_> Good/ - | |_> Medium/ - | |_> Poor/ - |_> ... ... ``` From 6b6d72d643156fd890cf9c2d6a2a3cb29ebfc90b Mon Sep 17 00:00:00 2001 From: Claude Formanek Date: Fri, 8 Mar 2024 09:44:50 +0200 Subject: [PATCH 3/4] Remove comment from README. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0ffa9e8c..efe85843 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ We have generated datasets on a diverse set of popular MARL environments. A list
- SMAC v2 Pistonball Cooperative Pong From 826ca0ca2c435fa0de540525c73b0086fccbc3ff Mon Sep 17 00:00:00 2001 From: Claude Formanek Date: Fri, 8 Mar 2024 09:46:57 +0200 Subject: [PATCH 4/4] Dataset storage structure -> dataset file structure in README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efe85843..92ee6825 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ We are in the process of migrating our datasets from TF Records to Flashbax Vaul | 🔴MPE | simple_adversary | 3 | Discrete. | Vector | Dense | Competitive | [source](https://pettingzoo.farama.org/environments/mpe/simple_adversary/) | ### Dataset and Vault Locations -For OG-MARL's systems, we require the following dataset storage structure: +For OG-MARL's systems, we require the following dataset file structure: ``` examples/