Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Code for the paper "Learning to Act by Predicting the Future" by Alexey Dosovitskiy and Vladlen Koltun

If you use this code or the provided environments in your research, please cite the following paper:

author    = {Alexey Dosovitskiy and Vladlen Koltun},
title     = {Learning to Act by Predicting the Future},
booktitle = {International Conference on Learning Representations (ICLR)},
year      = {2017}


  • master branch contains the algorithm implementation, example experiment configuration files and ViZDoom environment definitions (.cfg and .wad) - around 10Mb in total
  • pretrained_models branch additionally contains pre-trained models for all examples, and corresponding log files - around 200 Mb in total
  • Clone only the master branch to avoid extra traffic


  • ViZDoom
  • numpy
  • tensorflow
  • OpenCV python bindings
  • (optionally, cuda and cudnn)

Tested with:

  • Ubuntu 14.04
  • python 3.4
  • tensorflow 1.0
  • ViZDoom master branch commit ed25f236ac93fbe7f667d64fe48d733506ce51f4

Running the code:

  • Adjust ViZDoom path in

  • For testing, switch to the pretrained_models branch and run (using D3 as an example):

      cd examples/D3_battle
      python3 show
  • For training, run the following (using D2 as an example):

      cd examples/D3_battle
      python3 train
  • If you have multiple gpus, make sure that only one is visible with


    where NGPU is the number of GPU you want to use, or "" if you do not want to use a gpu

  • For speeding things up you may want to prepend "taskset -c NCORE" before the command, where NCORE is the number of the core to be used, for example:

      taskset -c 1 python3 train

    When training with a GPU, one core seems to perform the best. Without a GPU, you may want 4 or 8 cores.


  • For experiments in the paper we used a slightly modified ViZDoom version which provided a post-mortem measurement. This turns out to make a difference for training. For this reason, the results with this code and the default ViZDoom version may differ slightly from the results in the paper.

  • Results may vary across training runs: in our experiments, up to roughly 15%.

  • In battle scenarios, the reward provided by ViZDoom is the number of frags. For training the baseline approaches we did not use this reward, but rather a weighted average of the three measurements, same as for our approach, for a fair comparison.


Please send bug reports to Alexey Dosovitskiy


Code for the paper "Learning to Act by Predicting the Future", Alexey Dosovitskiy and Vladlen Koltun, ICLR 2017




No releases published


You can’t perform that action at this time.