yandexdataschool / tinyverse

Universe RL trainer platform. Simple. Supple. Scalable.
10 stars 5 forks source link

Universe RL trainer platform. Simple. Supple. Scalable.

Why should i care?

tinyverse is a reinforcement learning platform for gym/universe/custom environments that lets you utilize any resources you have to train reinforcement learning algorithm.

Key features

The core idea is to have two types of processes:

Those processes revolve around database that stores experience sessions and weights. The database is currently implemented with Redis since it is simple to setup and swift with key-value operations. You can, however, implement the database interface with what database you prefer.

Quickstart

  1. install redis server

    • (Ubuntu) sudo apt-get install redis-server
    • Mac OS version HERE.
    • Otherwise search "Install redis your_OS" or ask on gitter.
    • If you want to run on multiple machines, configure redis-server to listen to 0.0.0.0 (also mb set password)
  2. install python packages

    • gym and universe
    • pip install gym[atari]
    • pip install universe - most likely needs dependencies, see urls above.
    • install bleeding edge theano, lasagne and agentnet for agentnet examples to work.
    • Preferably setup theano to use floatX=float32 in .theanorc
    • pip install joblib redis prefetch_generator six
    • examples require opencv: conda install -y -c https://conda.binstar.org/menpo opencv3
  3. Spawn several player processes. Each process simply interacts and saves results. -b stands for batch size.

    for i in `seq 1 10`; 
    do
         python tinyverse atari.py play -b 3 &
    done
  4. Spawn trainer process. (demo below runs on gpu, change to cpu if you have to) THEANO_FLAGS=device=gpu python tinyverse atari.py train -b 10 &

  5. evaluate results at any time (records video to ./records) python tinyverse atari.py eval -n 5

Devs: see workbench.ipynb