Giter Site home page Giter Site logo

shadowkun / environment-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dgaddy/environment-learning

0.0 1.0 0.0 3.49 MB

Code for "Pre-Learning Environment Representations for Data-Efficient Neural Instruction Following"

Python 0.86% NewLisp 99.14%

environment-learning's Introduction

Environment Learning

This repository holds the code for the paper Pre-Learning Environment Representations for Data-Efficient Neural Instruction Following from ACL 2019.

Requirements

To run this code, you will need Python 3 with PyTorch 1.0 or greater, as well as the absl-py package.

Command Line Arguments

Block stacking

To run the experiments in the SHRDLURN blocks environment, use this command:

python3 evaluate.py --dataset stacks --pretrain_prefix "stacks_model_"

This will run the full model, including discrete representations and the encoder matching loss. To run without the model improvements, use:

python3 evaluate.py --dataset stacks --pretrain_prefix "stacks_model_" --continuous_message --model_message_loss_weight 0.0

Additional flags are defined at the top of the relevant python files.

To run a baseline model with no pre-training, use:

python3 evaluate.py --dataset stacks --baseline

String Manipulation

For the string manipulation environment, you will first need to generate pre-training transitions as a separate step with:

python3 regexp/generate.py

You will only need to run this once. Then, to run the actual experiments, use the command:

python3 evaluate.py --dataset regex --batch_increasing --model_train_decoder --pretrain_prefix "regex_model_"

Two-step Training

By default evaluate.py will run both pre-training and language learning, but you can also run these separately. First run pre-training with:

python3 pretrain.py --dataset stacks --pretrain_prefix "stacks_model_"

Then run evaluate.py with the same pretrain_prefix and it will load the pre-trained model:

python3 evaluate.py --dataset stacks --pretrain_prefix "stacks_model_"

environment-learning's People

Contributors

dgaddy avatar

Watchers

 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.