Home

Awesome

Imitation Learning with Dataset Aggregation (DAGGER) on Torcs Env

This repository implements a simple algorithm for imitation learning: DAGGER. In this example, the agent only learns to control the steer [-1, 1], the speed is computed automatically in gym_torcs.TorcsEnv.

Requirements

  1. Ubuntu (I only test on this)
  2. Python 3
  3. TensorLayer and TensorFlow
  4. Gym-Torcs

Setting Up

It is a little bit boring to set up the environment, but any incorrect configurations will lead to FAILURE. After installing Gym-Torcs, please follow the instructions to confirm everything work well:

Usage

Make sure everything above work well and then run:

It will start a Torcs server at the beginning of every episode, and terminate the server when the car crashs or the speed is too low. Note that, the self-contained gym_torcs.py is modified from Gym-Torcs, you can try different settings (like default speed, terminated speed) by modifying it.

Results

After Episode 1, the car crashes after 315 steps.

<!--- After Episode 2, crashes after 151 steps ![](http://i.imgur.com/0bXKyVx.gif) After Episode 3, crashes after 395 steps ![](http://i.imgur.com/doz8U0z.gif) After Episode 4, the car does not crash anymore: [gif](http://i.imgur.com/pKeVxLY.gif). -->

After Episode 3, the car does not crash anymore !!!

The number of steps and episodes might vary depending on the parameters initialization.

ENJOY !

<!--- Note: The images fed to the model are 64x64, the images shown above have been resized to 256x256 for viewing purposes. -->