Code Monkey home page Code Monkey logo

act2vec's Introduction

The Natural Language of Actions

This repository contains code for ICML 2019 The Natural Language of Actions.

@inproceedings{tennenholtz2019natural,
  title={The Natural Language of Actions},
  author={Tennenholtz, Guy and Mannor, Shie},
  booktitle={ICML},
  year={2019}
}

About

The code is divided into the three domains tested in the original paper: QuickDraw, Navigation, and StarCraft2.

Alt Text

Datasets

All three folders contain the corpus of actions used, except for StarCraft2, where the file size of the corpus was very large. For the case of StarCraft2 a sample of the action corpus is provided, which is enough to get a noisy estimate of the same results. Those who are interested can use PySC2 to download more replays and train their own Act2Vec model on them.

Trained Act2Vec embeddings of all three environments are provided.

The Quick,Draw! dataset can be found in https://github.com/googlecreativelab/quickdraw-dataset. We have provided the square category used in the paper.

For StarCraft II we divided the action space into the three races - available in three separate json files: terran_actions.json, protoss_actions.json, and zerg_actions.json. common_action.json includes all actions that are common to all races (such as moving the camera).

Using the Code

preprocess.py

Responsible for creating embeddings using the provided action corpus. There are a lot of interesting parameters to play with including: continuous embedding, window width, embedding dimension, bag of words context, and more.

plot_embeddings.py

Plots the trained Act2Vec embeddings.

Environments

QuickDraw/rect_painter_trainer.py will train the square agent. Make sure to input the test and parameters you want. Tests available are: action2vec, action2vec_normalized, one_hot, or random. An example of use:

python3 QuickDraw/rect_painter_trainer.py action2vec --embedding_dim 10 --window 2 --square_size 12 --n_iters 10000000 --n_trials 15 --gpu 0 --save_id 0

The QuickDraw environment uses stable_baselines - but we have modified it a bit. The modified version is included in the QuickDraw/stable_baselines folder.

Navigation/rl_3d is based on the GitHub repository: https://github.com/avdmitry/rl_3d. Training is done similarly as explained on their GitHub page. We added parameters relating to using action embeddings with Q-embedding and k-Exp.

act2vec's People

Contributors

guytenn 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.