Git Product home page Git Product logo

yenchenlin / nips2015-action-conditional-video-prediction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from junhyukoh/nips2015-action-conditional-video-prediction

0.0 3.0 0.0 15.5 MB

Implementation of "Action-Conditional Video Prediction using Deep Networks in Atari Games"

Home Page: https://sites.google.com/a/umich.edu/junhyuk-oh/action-conditional-video-prediction

CMake 1.46% Jupyter Notebook 49.95% Makefile 0.31% Shell 0.45% Python 5.45% HTML 0.10% CSS 0.13% C++ 38.59% Cuda 2.42% MATLAB 0.44% M 0.01% Protocol Buffer 0.72%

nips2015-action-conditional-video-prediction's Introduction

Introduction

This repository implements the main algorithm of the following paper (Project website):

  • Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard Lewis, Satinder Singh, "Action-Conditional Video Prediction using Deep Networks in Atari Games" In Advances in Neural Information Processing Systems (NIPS), 2015.
@incollection{NIPS2015_5859,
author = {Oh, Junhyuk and Guo, Xiaoxiao and Lee, Honglak and Lewis, Richard L and Singh, Satinder},
booktitle = {Advances in Neural Information Processing Systems 28},
editor = {Cortes, C and Lawrence, N D and Lee, D D and Sugiyama, M and Garnett, R and Garnett, R},
pages = {2845--2853},
publisher = {Curran Associates, Inc.},
title = {{Action-Conditional Video Prediction using Deep Networks in Atari Games}},
year = {2015}
}

Installation

This repository contains a modified version of Caffe and uses its python wrapper (pycaffe).
Please check the following instruction to compile Caffe: http://caffe.berkeleyvision.org/installation.html.
After installing the libraries required by Caffe, you should be able to compile the code succesfully as follows:

cd caffe
make
make pycaffe

Data structure

The data directories should be organized as follows:

./[game name]/train/[%04d]/[%05d].png  # training images
./[game name]/train/[%04d]/act.log     # training actions
./[game name]/test/[%04d]/[%05d].png   # testing images
./[game name]/test/[%04d]/act.log      # testing actions
./[game name]/mean.binaryproto         # mean pixel image

[%04d] and [%05d] correspond to episode index and frame index respectively (starting from 0).
Each line of act.log file specifies the action index (starting from 0) chosen by the player for each time step.

[action idx at time 0]
[action idx at time 1]
[action idx at time 2]
...

The mean pixel values should be computed over the entire training images and be converted to binaryproto using Caffe.

Training

The following scripts are provided for training:

  • train_cnn.sh : train a feedforward model on 1-step, 3-step, 5-step objectives.
  • train_lstm.sh : train a recurrent model on 1-step, 3-step, 5-step objectives.
  • train.sh : train any types of models with user-specified details (batch_size, pre-trained weights, etc)

The following command shows how to run training scripts:

cd [game name]
../train_cnn.sh [num_actions] [gpu_id]
../train_lstm.sh [num_actions] [gpu_id]
../train.sh [model_type] [result_prefix] [lr] [num_act] [...]

Testing

The following scripts are provided for testing:

  • test_cnn.sh : shows predictions from a trained feedforward model.
  • test_lstm.sh : shows predictions from a trained recurrent model.
  • test.sh : shows predictions from a trained model with user-specified details

The following command shows how to run the testing script:

cd [game name]
../test_cnn.sh [weights] [num_actions] [num_step] [gpu_id]
../test_lstm.sh [weights] [num_actions] [num_step] [gpu_id]
../test.sh [model_type] [weights] [num_action] [num_input_frames] [num_step] [gpu_id] [...]
  • If line 31 of test.py gives an error, you have to replace the default font path with a path for any fonts
font = ImageFont.truetype('[path for a font]', 20)

Details

This repository uses ADAM optimization method, while RMSProp is used in the original paper. We found that ADAM converges more quickly, and 3-step training is almost enough to get reasonable results.

nips2015-action-conditional-video-prediction's People

Contributors

junhyukoh avatar

Watchers

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