All Projects → CPS-TUWien → racing_dreamer

CPS-TUWien / racing_dreamer

Licence: other
Latent Imagination Facilitates Zero-Shot Transfer in Autonomous Racing

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects
CMake
9771 projects
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to racing dreamer

Macad Gym
Multi-Agent Connected Autonomous Driving (MACAD) Gym environments for Deep RL. Code for the paper presented in the Machine Learning for Autonomous Driving Workshop at NeurIPS 2019:
Stars: ✭ 106 (+241.94%)
Mutual labels:  deep-reinforcement-learning, autonomous-driving
l2r
Open-source reinforcement learning environment for autonomous racing.
Stars: ✭ 38 (+22.58%)
Mutual labels:  deep-reinforcement-learning, autonomous-driving
Master-Thesis
Deep Reinforcement Learning in Autonomous Driving: the A3C algorithm used to make a car learn to drive in TORCS; Python 3.5, Tensorflow, tensorboard, numpy, gym-torcs, ubuntu, latex
Stars: ✭ 33 (+6.45%)
Mutual labels:  deep-reinforcement-learning, autonomous-driving
Carla
Open-source simulator for autonomous driving research.
Stars: ✭ 7,012 (+22519.35%)
Mutual labels:  deep-reinforcement-learning, autonomous-driving
Gym Carla
An OpenAI gym wrapper for CARLA simulator
Stars: ✭ 164 (+429.03%)
Mutual labels:  deep-reinforcement-learning, autonomous-driving
omd
JAX code for the paper "Control-Oriented Model-Based Reinforcement Learning with Implicit Differentiation"
Stars: ✭ 43 (+38.71%)
Mutual labels:  deep-reinforcement-learning, model-based-reinforcement-learning
Carla-ppo
This repository hosts a customized PPO based agent for Carla. The goal of this project is to make it easier to interact with and experiment in Carla with reinforcement learning based agents -- this, by wrapping Carla in a gym like environment that can handle custom reward functions, custom debug output, etc.
Stars: ✭ 122 (+293.55%)
Mutual labels:  deep-reinforcement-learning, autonomous-driving
RL
Reinforcement Learning Demos
Stars: ✭ 66 (+112.9%)
Mutual labels:  deep-reinforcement-learning
drl grasping
Deep Reinforcement Learning for Robotic Grasping from Octrees
Stars: ✭ 160 (+416.13%)
Mutual labels:  deep-reinforcement-learning
MP-DQN
Source code for the dissertation: "Multi-Pass Deep Q-Networks for Reinforcement Learning with Parameterised Action Spaces"
Stars: ✭ 99 (+219.35%)
Mutual labels:  deep-reinforcement-learning
pillar-motion
Self-Supervised Pillar Motion Learning for Autonomous Driving (CVPR 2021)
Stars: ✭ 98 (+216.13%)
Mutual labels:  autonomous-driving
muzero
A clean implementation of MuZero and AlphaZero following the AlphaZero General framework. Train and Pit both algorithms against each other, and investigate reliability of learned MuZero MDP models.
Stars: ✭ 126 (+306.45%)
Mutual labels:  deep-reinforcement-learning
efficient online learning
Efficient Online Transfer Learning for 3D Object Detection in Autonomous Driving
Stars: ✭ 20 (-35.48%)
Mutual labels:  autonomous-driving
CrowdNav DSRNN
[ICRA 2021] Decentralized Structural-RNN for Robot Crowd Navigation with Deep Reinforcement Learning
Stars: ✭ 43 (+38.71%)
Mutual labels:  deep-reinforcement-learning
pokeai
Develop ultimate AI Pokémon trainer
Stars: ✭ 18 (-41.94%)
Mutual labels:  deep-reinforcement-learning
code summarization public
source code for 'Improving automatic source code summarization via deep reinforcement learning'
Stars: ✭ 71 (+129.03%)
Mutual labels:  deep-reinforcement-learning
rtrl
PyTorch implementation of our paper Real-Time Reinforcement Learning (NeurIPS 2019)
Stars: ✭ 57 (+83.87%)
Mutual labels:  deep-reinforcement-learning
Autonomous-RC-Car
Self-driving RC Car ROS Software
Stars: ✭ 17 (-45.16%)
Mutual labels:  autonomous-driving
YOLOP
You Only Look Once for Panopitic Driving Perception.(https://arxiv.org/abs/2108.11250)
Stars: ✭ 1,228 (+3861.29%)
Mutual labels:  autonomous-driving
MotionNet
CVPR 2020, "MotionNet: Joint Perception and Motion Prediction for Autonomous Driving Based on Bird's Eye View Maps"
Stars: ✭ 141 (+354.84%)
Mutual labels:  autonomous-driving

Latent Imagination Facilitates Zero-Shot Transfer in Autonomous Racing

We train a model-based RL agent in simulation and, without finetuning, transfer it to small-scale race cars.

Racing Dreamer

Paper is available on arXiv.

This repository is organized as follows:

  • Folder dreamer contains the code related to the Dreamer agent.
  • Folder baselines contains the code related to the Model Free algorihtms (D4PG, MPO, PPO, LSTM-PPO, SAC).
  • Folder ros_agent contains the code related to the transfer on real racing cars.
  • Folder docs contains the track maps, mechanical and general documentation.

Dreamer

"Dreamer learns a world model that predicts ahead in a compact feature space. From imagined feature sequences, it learns a policy and state-value function. The value gradients are backpropagated through the multi-step predictions to efficiently learn a long-horizon policy."

This implementation extends the original implementation of Dreamer (Hafner et al. 2019).

We refer the reader to the Dreamer website for the details on the algorithm.

Dreamer

Instructions

This code has been tested on Ubuntu 18.04 with Python 3.7.

Get dependencies:

pip install --user -r requirements.txt

Training

We train Dreamer on LiDAR observations and propose two Reconstruction variants: LiDAR and Occupancy Map.

Reconstruction Variants

Train the agent with LiDAR reconstruction:

python dreamer/dream.py --track columbia --obs_type lidar

Train the agent with Occupancy Map reconstruction:

python dream.py --track columbia --obs_type lidar_occupancy

Please, refer to dream.py for the other command-line arguments.

Offline Evaluation

The evaluation module runs offline testing of a trained agent (Dreamer, D4PG, MPO, PPO, SAC).

To run evaluation, assuming to have the dreamer directory in the PYTHONPATH:

python evaluations/run_evaluation.py --agent dreamer \
                                     --trained_on austria \
                                     --obs_type lidar \
                                     --checkpoint_dir logs/checkpoints \
                                     --outdir logs/evaluations \
                                     --eval_episodes 10 \
                                     --tracks columbia barcelona 

The script will look for all the checkpoints with pattern logs/checkpoints/austria_dreamer_lidar_* The checkpoint format depends on the saving procedure (pkl, zip or directory).

The results are stored as tensorflow logs.

Plotting

The plotting module containes several scripts to visualize the results, usually aggregated over multiple experiments.

To plot the learning curves:

python plotting/plot_training_curves.py --indir logs/experiments \
                                                --outdir plots/learning_curves \
                                                --methods dreamer mpo \
                                                --tracks austria columbia treitlstrasse_v2 \
                                                --legend

It will produce the comparison between Dreamer and MPO on the tracks Austria, Columbia, Treitlstrasse_v2.

To plot the evaluation results:

python plotting/plot_test_evaluation.py --indir logs/evaluations \
                                                --outdir plots/evaluation_charts \
                                                --methods dreamer mpo \
                                                --vis_tracks austria columbia treitlstrasse_v2 \
                                                --legend

It will produce the bar charts comparing Dreamer and MPO evaluated in Austria, Columbia, Treitlstrasse_v2.

Instructions with Docker

We also provide an docker image based on tensorflow:2.3.1-gpu. You need nvidia-docker to run them, see here for more details.

To build the image:

docker build -t dreamer .

To train Dreamer within the container:

docker run -u $(id -u):$(id -g) -v $(pwd):/src --gpus all --rm dreamer python dream.py --track columbia --steps 1000000

Model Free

The organization of Model-Free codebase is similar and we invite the users to refer to the README for the detailed instructions.

Hardware

The codebase for the implementation on real cars is contained in ros_agent.

Additional material:

  • Folder docs/maps contains a collection of several tracks to be used in F1Tenth races.
  • Folder docs/mechanical contains support material for real world race-tracks.

Citation

If you find this work useful for your own ideas, please cite our paper:

@misc{brunnbauer2022latent,
      title={Latent Imagination Facilitates Zero-Shot Transfer in Autonomous Racing}, 
      author={Axel Brunnbauer and Luigi Berducci and Andreas Brandstätter and Mathias Lechner and Ramin Hasani and Daniela Rus and Radu Grosu},
      year={2022},
      eprint={2103.04909},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].