/SemesterProject

Primary LanguagePythonMIT LicenseMIT

Prerequisites

This specific image needs a CUDA capable GPU with CUDA version 10.0 and nvidia-docker version 2 installed on the host machine

Reproducing the results

Create working directory and clone the repo

  1. mkdir ffabi_shared_folder

  2. cd ffabi_shared_folder

  3. git clone https://github.com/ffabi/SemesterProject.git

    Building the image:

  4. cd SemesterProject/docker_setup

  5. docker build -f Dockerfile -t ffabi/gym:10 .

  6. cd ../../..

    Or pull from Dockerhub: docker pull ffabi/gym:10

    Running the docker container:

  7. nvidia-docker create -p 8192:8192 -p 8193:22 -p 8194:8194 --name ffabi_gym -v $(pwd)/ffabi_shared_folder:/root/ffabi_shared_folder ffabi/gym:10

  8. nvidia-docker start ffabi_gym

    Attach to the container:

  9. docker exec -it ffabi_gym bash

    Running AppliedDataSciencePartners - WorldModels:

  10. cd ffabi_shared_folder/SemesterProject/applied_worldmodel

  11. mkdir data log

    Generate random rollouts:

    I recommend to use screen:

  12. screen -R train to enter screen 'train' (press Ctrl+A and Ctrl+D to exit)

  13. xvfb-run -a python3 01_generate_random_data.py

  14. xvfb-run -a python3 01_generate_random_data.py --validation

    Train the VAE:

  15. xvfb-run -a python3 02_train_vae.py --num_files 10

    Generate input for the RNN:

  16. xvfb-run -a python3 03_generate_rnn_data.py --num_files 10

  17. xvfb-run -a python3 03_generate_rnn_data.py --num_files 10 --validation

    Train the RNN:

  18. xvfb-run -a python3 04_train_rnn.py --start_batch 0 --max_batch 0 --new_model

    Train the Controller:

  19. xvfb-run -a python3 05_train_controller.py car_racing --num_worker 1 --num_worker_trial 2 --num_episode 4 --max_length 1000 --eval_steps 25

Test your agent

  1. python3 model.py car_racing --filename controller.json --render_mode

Source: https://medium.com/applied-data-science/how-to-build-your-own-world-model-using-python-and-keras-64fb388ba459