Code Monkey home page Code Monkey logo

spiral-tensorflow's Introduction

SPIRAL in TensorFlow (in progress)

TensorFlow implementation of Synthesizing Programs for Images using Reinforced Adversarial Learning (SPIRAL).

model

SPIRAL is an adversarially trained agent that generates a program which is executed by a graphics engine to interpret and sample images. This agent is trained to fool a discriminator with a distributed reinforcement learning without any supervision.

In short, Distributed RL + GAN + Program synthesis.

Prerequisites

Usage

Install prerequisites with:

./install.sh
pip install -r requirements.txt

To debug a SPIARL model:

python run.py --num_workers 8 --env simple --episode_length=1 \
              --location_size=8 --conditional=True \
              --loss=l2 --policy_batch_size=1

To train a SPIARL model:

python run.py --num_workers 16 --env simple_mnist --episode_length=3 \
              --color_channel=1 --location_size=32 --loss=gan --num_gpu=1 \
              --disc_dim=8 --conditional=False \
              --mnist_nums=1,7 --jump=False --curve=False

python run.py --num_workers 24 --env simple_mnist --episode_length=6 \
              --color_channel=1 --location_size=32 --loss=gan --num_gpu=2 \
              --disc_dim=64 --conditional=False \
              --mnist_nums=0,1,2,3,4,5,6,7,8,9 --jump=True

python run.py --num_workers 12 --env simple_mnist --episode_length=2 \
              --color_channel=1 --location_size=32 --conditional=True \
              --mnist_nums=1 --loss=gan

python run.py --num_workers 24 --env simple_mnist --episode_length=3 \
              --color_channel=1 --location_size=32 --conditional=True \
              --mnist_nums=1,2,7 --loss=l2

python run.py --num_workers 24 --env simple_mnist --episode_length=3 \
              --color_channel=1 --location_size=32 --conditional=True \
              --mnist_nums=1,2,7 --loss=gan --num_gpu=2

python run.py --num_workers 24 --env simple_mnist --episode_length=5 \
              --color_channel=1 --location_size=32 --conditional=True \
              --mnist_nums=0,1,2,7 --loss=gan --num_gpu=2

Results

(in progress)

Random generated samples at early stage:

model

Incorrectly converged samples at early stage:

model

Tensorboard:

model

To-do

  • IMPALA A2C
  • IMPALA V-trace
  • Simple environment (debugging)
  • Find a correct libmypaint setting
  • MNIST environment
  • ReplayThread (--loss=gan)
  • --num_gpu=2 test
  • --conditional=True (need more details)
  • Replay memory needs more detailed information
  • Population Based Training (to be honest, I don't have any plan for this)

References

This code is heavily based on openai/universe-starter-agent.

Author

Taehoon Kim / @carpedm20

spiral-tensorflow's People

Contributors

carpedm20 avatar chris-chris avatar

Watchers

James Cloos avatar  avatar  avatar paper2code - bot 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.