Code Monkey home page Code Monkey logo

traffic_light_rl's Introduction

traffic_light_rl

This is a single traffic signal control system implemented using reinforcement learning. To further improve the training performance of DQN, the gradient-based meta-learning algorithm is integrated (GBML-DQN). It belongs to AutoRL and can adjust the parameter gamma during training. Experiments show that GBML-DQN promotes convergence of the Q-value function and avoids overestimation to some extent, especially in the case of inappropriate training settings, whereas DQN fails in training.

Experiments are designed for comparing the training performance using different algorithms (DQN, GBML-DQN) with different optimizers (SGD, RMSprop). The figures of experiments are as follows. For more figures, please check in folder record. image

Useful Links

Paper: https://ieeexplore.ieee.org/document/10098238

Quick Start

1. Install SUMO (a traffic simulator)

Linux: the github repository of SUMO

Download the code:

git clone https://github.com/eclipse/sumo.git

Build and installation for Ubuntu:

sudo apt-get install cmake python g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev swig
cd <SUMO_DIR> # please insert the correct directory name here
export SUMO_HOME="$PWD"
mkdir build/cmake-build && cd build/cmake-build
cmake ../..
make -j$(nproc)

Windows: Download zip or msi

Set the environment variable:

SUMO_HOME=<SUMO_DIR>

2. Check and install the dependencies

cd <traffic_light_rl>
pip install -r requirements.txt

3. Run code

There are two modes, train and eval. The mode train is for training and eval is for testing the performance of the trained agent. You can choose values of your parameters by directly modifying the code (FLAGS) in main.py, or running the code with parameters like:

# directly append parameters to the console
python main.py -gamma=0.9 -num_episodes=600

# or modifying the config file and append it to the console
python main.py -flagfile=xx.cfg

Train:

cd <traffic_light_rl>
python main.py

Eval:

cd <traffic_light_rl>
python main.py -flagfile=eval.cfg

traffic_light_rl's People

Contributors

desny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

traffic_light_rl's Issues

HELP

这个main.py是用来训练的吗??那训练好的模型怎么测试?

****

help

您好,请问您的状态、动作和奖励具体是怎么定义的啊,我看代码的时候没太能理解,所以来请教您,希望您能解答,十分感谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.