Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A framework where a deep Q-Learning Reinforcement Learning agent tries to choose the correct traffic light phase at an intersection to maximize traffic efficiency.
| Date | Stars |
|---|---|
| 2026-07-31 | 505 |
| 2026-08-01 | 505 |
| 2026-08-02 | 505 |
| 2026-08-06 | 505 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Deep Q-Learning Agent for Traffic Signal Control > **Note:** this project was refactored in November 2025 to improve clarity and modernize the tooling. The previous version is available at [this commit](https://github.com/AndreaVidali/Deep-QLearning-Agent-for-Traffic-Signal-Control/tree/8ee45192c0ef6b3d43dd660505a38b5030b79be7). A PyTorch-based Deep Q-Learning agent that learns to operate a single 4-way intersection in **SUMO**. The repo bundles a configurable training pipeline, a small CLI, and plotting utilities so you can focus on experimenting. - **Agent**: epsilon-greedy DQN with experience replay and a configurable fully connected network. - **Environment**: fixed SUMO intersection; state is 80 binary cells from discretized incoming lanes; 4 traffic-signal actions. - **Outputs**: trained model, copied settings, and plots for rewards, delay, and queue lengths. ## Prerequisites - [uv](https://astral.sh/uv) installed. - Python 3.13 (see `pyproject.toml`; you can manage Python versions directly via [uv](https://astral.sh/uv), which can download it for you). - SUMO installed and available via `sumo` / `sumo-gui` on your PATH. To do so, the environment variable `SUMO_HOME` must be set. For specific instructions, check out the [official installation page](https://sumo.dlr.de/docs/Installing/). - GPU is optional; the default configuration trains on CPU. > **Note:** as of November 2025, macOS Tahoe and SUMO-GUI have an issue that can crash the SUMO GUI. In particular, the bug lies with the XQuartz library. See: > > - https://github.com/eclipse-sumo/sumo/issues/17272 > - https://github.com/XQuartz/XQuartz/issues/446 > - https://github.com/XQuartz/XQuartz/issues/438#issuecomment-3350746279 ## Getting started Clone the repo. Then from the project root, install the dependencies: ```bash uv sync ``` Activate the virtual environment: ```bash source .venv/bin/activate # on Windows: .venv\Scripts\activate ``` To check if the installation was successful, verify that the CLI is available: ```bash tlcs --help ``` When you are finished, deactivate the virtual environment: ```bash deactivate ``` Alternatively, if you prefer not to activate the environment explicitly, you can run commands via uv: ```bash uv run tlcs --help ``` ## Train and test Training and testing read YAML configuration from `settings/`. Both commands prompt before overwriting existing output folders. - **Train** (defaults to `settings/training_settings.yaml`, writes to `model/`): ```bash tlcs train # or choose a custom run folder tlcs train --out-path model/run-01 ``` - **Test** a trained run (defaults to `settings/testing_settings.yaml`, writes to `model/<run>/test/`): ```bash tlcs test --model-path model/run-01 --test-name foo ``` Discover all options with: ```bash tlcs train --help tlcs test --help ``` ## The settings Configs live in `settings/` and are validated at runtime. `training_settings.yaml` - `gui`: run SUMO with (`true`) or without (`false`) the GUI. - `total_episodes`, `max_steps`, `n_cars_generated`: episode count, length, and traffic volume. - `green_duration`, `yellow_duration`: phase durations in seconds. - `turn_chance`: probability that a vehicle turns instead of going straight. - `num_layers`, `width_layers`: hidden layer count and width for the neural network. - `batch_size`, `learning_rate`, `training_epochs`: replay batch size, optimizer LR, and training passes per episode. - `memory_size_min`, `memory_size_max`: replay buffer warmup and capacity. - `gamma`: discount factor. - `sumocfg_file`: SUMO config path (defaults to `intersection/sumo_config.sumocfg`). `testing_settings.yaml` - Mirrors the simulation settings (`gui`, `max_steps`, `n_cars_generated`, `green_duration`, `yellow_duration`, `turn_chance`, `gamma`, `sumocfg_file`) plus: - `episode_seed`: deterministic route generation for a reproducible test episode. ## What gets saved Each training run writes to the chosen output training folder:
Excerpt of 7,794 characters
Read on GitHub1
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:7be03dcba6d718e0, topic:deep-reinforcement-learning, desc:reinforcement learning, desc:q-learning