Git Product home page Git Product logo

gpl's Introduction

Open Ad Hoc Teamwork using Graph-based Policy Learning

This folder contains the implementation of the environments, experiments, and the GPL algorithm proposed in the Open Ad Hoc Teamwork using Graph-based Policy Learning paper.

Requirements

To install required packages, execute the following command:

pip install -r requirements.txt

We also require a modified version of OpenAI gym to run the provided codes. To do the necessary modifications to gym, check the directory of the gym package using

pip show gym

Assuming the package is installed in <DIR>, replace <DIR>/gym/vector/async_vector_env.py with the async_vector_env.py that we have provided. This can be achieved using the following command :

cp async_vector_env.py <DIR>/gym/vector/async_vector_env.py

Training

The codes for our open ad hoc teamwork experiments are provided in Open_Experiments folder. The Open_Experiments folder contains three folders, each containing the environment, GPL-Q, and GPL-SPI implementation for a specific environment used in our work. Before training the models in LBF and Wolfpack, make sure to install the environments used in the experiments using the following commands:

cd Open_Experiments/<Environment Name>/env
pip install -e .

For all environments, run this command to train GPL-Q or GPL-SPI :

cd Open_Experiments/<Environment Name>/<Approach Name>
./runner.sh

Full description of the hyperparameters and the architecture used in our work is provided in the appendix of our work.

Aside from training a GPL-Q of GPL-SPI model, the shell script also periodically checkpoints the model and evaluates it in the training and evaluation environment. We specifically run several episodes under the evaluation setup and log the resulting performance using tensorboard. The resulting logs can be viewed using the following command :

tensorboard --logdir=Open_Experiments/<Environment Name>/<Approach Name>/runs

Using the displayed logs, we can see the different metrics we reported in our work such as the average total returns per episode and the shooting accuracy of the learner. To compile the logs of the experiments into the plots we included in our work, you can download the logs as a csv and use the visualization codes in the Visualization folder.

Visualization

The visualization codes are provided in the Visualization folder. For results that we have provided in our work, you can compile these visualization by running the vis.py file in each of the folders inside the Visualization folder.

Joint Action value analysis

For joint action value analysis, you must first gather the joint action value data. You can do this by running,

cd Action_Value_Analysis/Data_Collection
./runner.sh

This will results in several numpy arrays being stored in Action_Value_Analysis/Data_Collection. To do the analysis, you could then move these numpy arrays to the folder that contains the jupyter notebook for data analysis. You can do this by :

mv Action_Value_Analysis/Data_Analysis/*.npy Action_Value_Analysis/Data_Analysis

You can then run jupyter and execute the commands in the notebook. The visualizations of the metrics proposed in our work can be seen in the final two images produced in the notebook.

gpl's People

Contributors

raharrasy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.