odelalleau / nucl.ai-vizdoom-workshop

nucl.ai 2016 Hands-On Deep Q-Learning in Doom Workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nucl.ai 2016 Hands-On Deep Q-Learning in Doom Workshop

Prerequisites

Task 1: Learn the capabilities of the environment

  1. Analyze and execute examples/python/basic.py.
  2. Play with the rendering options (hud, crosshair, resolution, etc.)
  3. Learn how to use the modes: SPECTATOR, PLAYER, ASYNC_SPECTATOR, ASYNC_PLAYER
  4. Play with the tics parameter of doom.make_action()
  5. See the sample scenarios in ASYNC_SPECTATOR mode, observe the rewards on the console (examples/python/scenarios.py)
  6. Speed up the time in ASYNC_SPECTATOR mode (examples/python/ticrate.py).
  7. Play with the other capabilities of ViZDoom: - Benchmark your ViZDoom offscreen (examples/python/fps.py) - See the depth buffer feature (examples/python/format.py) - Execute multiple instances of Doom at once (examples/python/multiple_instances.py) - Record the game in low-resolution settings and replay it in high-resolution (examples/python/record_episodes.py)
  8. Play the examples/python/cig_bots.py to get the feeling of the CIG 2016 ViZDoom Competition

Task 2: Teach your agent to play a basic scenario

  1. Clone this repo
  2. Copy (or make symlinks), so that the system sees vizdoom.so and the vizdoom executable, e.g.:
ln -s ../ViZDoom/bin/vizdoom
ln -s ../ViZDoom/bin/python/vizdoom.so
  1. Execute the simple_dqn_task.py, which runs on simpler_basic scenario, by default. * Note: see run_cpu.sh
  2. Analyze the code. Most of the logic is already there. The only thing missing is the body of the perform_learning_step() function. It is your job to fill it up. Follow the instructions in the comments.
  3. When your code produces competent agents (mean score of 70-80 points), you might want to see your agent in action in better resolution and color, for which you have two options: * Increase the Doom's resolution and set the screen format to RGB24 in simpler_basic.cfg. (You also need to uncomment the rgb2gray() call in preprocess()). Note that, with higher resolution and color space conversion, the training will take 2-4 more time to complete. * Record your agent actions and replay it in rendering settings of your choice (consult record_episodes.py example). This option does not require retraining the agent.
  4. You might benchmark yourself on this scenario. Can you been your bot?
  5. Next, you can try your code on the rocket_basic scenario, which is slightly harder. * Hint: let the agent learn for 40-50 epochs.

Notes

  • The scenarios and the code for learning have been prepared so that training your agent should take approximately 1-10 minutes on a CPU, depending on the scenario and rendering settings.
  • You might want to play with learning_rate and frames_repeat parameters
  • The solution to Task 2 is provided in simple_dqn_solution.py. Just play with it, if you are not in the mood of a bit of coding.

Documentation

Currently, ViZDoom documentation consists of a tutorial and examples.

Authors

About

nucl.ai 2016 Hands-On Deep Q-Learning in Doom Workshop


Languages

Language:Python 98.2%Language:Shell 1.8%