RLAI Reinforcement Learning and Artificial Intelligence (RLAI)
Tile Coding Software

The ambition of this page is to very briefly describe the tile coding functions and their various versions and implementations such that readers can quickly determine whether or not they are likely to meet their needs.  External documentation is not here but is pointed to from here.


Tile coding is a way of representing the values of a vector of continuous variables as a large binary vector with few 1s and many 0s. The main step is to partition, or tile, the continuous space multiple times and select one tile from each tiling, that corresponding the the vector's value. Each tile is converted (hashed down to) an element in the big binary vector, and the list of the tile (element) numbers is returned as the representation of the vector's value. Information and examples of tile coding and its use in function approximation and reinforcement learning are given in Section 8.3.2 of the RL textbook. The version provided here includes code for handling collisions and a wrap version as well.

Note: the new version (as of January 25, 2005) has different function names than previous versions. The function getTiles is now tiles, loadTiles is loadtiles, tilesWrap is tileswrap and loadTilesWrap is now loadtileswrap. The arguments to these functions have not changed, and neither has CollisionTable.

Python Installation of Tiles

Requirements:

Installation:

Usage:


Python Calling C Version of Tiles: Installation

This version allows you to have the extra speed of the C version of tiles but still write your programs in Python.

Requirements:

Installation:

Usage:


Lisp Installation of Tiles

Requirements:

Installation:


C Installation of Tiles

Requirements:

Installation:



Timing Results

For comparison timings, see the following table. The tests were run on a Mac powerbook with 1 G memory. For 10,000 calls to tiles, each with 4 tilings and 2 floats:

Tiles Version
Python
Lisp
C
Python calling C
Regular:    no collision table
 1.03 sec      
 0.19 sec
 0.02 sec      
 0.09 sec
                unsafe collision table
 1.56 sec
 0.26 sec
 0.06 sec
 0.10 sec
                safe collision table
 1.73 sec
 0.29 sec
 0.04  sec
 0.10 sec
                super safe collision table
 2.19 sec
 0.24 sec
 0.06 sec
 0.10 sec
Wrap:        no collision table  1.50 sec
 1.38 sec(GC)
 0.02 sec
 0.12 sec
                unsafe collision table  1.86 sec
 0.29 sec
 0.05 sec
 0.11 sec
                safe collision table  1.93 sec
 0.29 sec
 0.03 sec
 0.13 sec
                super safe collision table
 1.64 sec
 0.25 sec
 0.05 sec
 0.12 sec
Load:         no collision table
 1.22 sec
 0.27 sec
 0.0003 sec
 5.9 sec
                unsafe collision table
 1.81 sec
 1.57 sec(GC)
 0.0004 sec
 5.8 sec
                safe collision table
 1.96 sec
 0.31 sec
 0.0004 sec
 5.9 sec
                super safe collision table
 1.78 sec
 0.27 sec
 0.0004 sec
 6.4 sec
Load wrap: no collision table
 1.39 sec
 0.21 sec
 0.0002 sec
 5.8 sec
                unsafe collision table
 1.87 sec
 0.30 sec
 0.0003 sec
 5.9 sec
                safe collision table
 1.95 sec
 0.29 sec
 0.0003 sec
 5.8 sec
                super safe collision table
 1.62 sec
 0.35 sec
 0.0005 sec
 5.9 sec



Extend this Page   How to edit   Style   Subscribe   Notify   Suggest   Help   This open web page hosted at the University of Alberta.   Terms of use  3668/1