GithubHelp home page GithubHelp logo

codraw's Introduction

codraw

This is an implementation of neural drawer model from CoDraw. As the initial aim is to modernize the source code and reproduce the results, I only make minimal changes wherever necessary due to time constraint. The drawer model in model/model.py and its corresponding helper in model/model_utils.py can be merged into one class if no further extension is desired. The dataloader for dev and test set will probably need some work, as it is intrinsically tied to the evaluation function. The dataloader function for training is already modernized with torch.utils.data.Dataset.

Training

You can set the path to CoDraw JSON file in cfgs/path_cfgs.py. A sample config file to train the model in the paper already exists (cfgs/sample_config.yml). The CoDraw dataset repository is expected to be at the same level with this repository, similar to the original configuration. The following script will run training:

python3 main.py --RUN train --MODEL_CONFIG <model_config>

with checkpoint saved under /ckpts.

Important parameters:

  1. --VERSION str, to assign a name for the model.
  2. --GPU str, to train the model on specified GPU. For multi-GPU training, use e.g. --GPU '0, 1, 2, ...'.
  3. --SEED int, set seed for this experiment.
  4. --NW int, to accelerate data loading speed.

To check all possible parameters, use --help. Currently --RESUME and --SPLIT flags can be ignored.

Testing

You can evaluate on validation or test set using --RUN {val, test}. For example:

$ python3 main.py --RUN test --MODEL_CONFIG <model_config> --CKPT_V <model_version> --CKPT_E <model_epoch>

or with absolute path:

$ python3 main.py --RUN test --MODEL_CONFIG <model_config> --CKPT_PATH <path_to_checkpoint>.pkl

The seed to reproduce the final result in the paper is 38957599 (for neural drawer evaluations against script, in which they use split 'b' in the official implementation).

codraw's People

Contributors

pkhdipraja avatar

Stargazers

Jeff Carpenter avatar Brie 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.