All Projects → PoCInnovation → Underflow

PoCInnovation / Underflow

Licence: Apache-2.0 license
With underflow, create trafic light clusters that interact together to regulate circulation

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Underflow

Reinforcementlearning Atarigame
Pytorch LSTM RNN for reinforcement learning to play Atari games from OpenAI Universe. We also use Google Deep Mind's Asynchronous Advantage Actor-Critic (A3C) Algorithm. This is much superior and efficient than DQN and obsoletes it. Can play on many games
Stars: ✭ 118 (+883.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Hands On Intelligent Agents With Openai Gym
Code for Hands On Intelligent Agents with OpenAI Gym book to get started and learn to build deep reinforcement learning agents using PyTorch
Stars: ✭ 189 (+1475%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Baby A3c
A high-performance Atari A3C agent in 180 lines of PyTorch
Stars: ✭ 144 (+1100%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch sac ae
PyTorch implementation of Soft Actor-Critic + Autoencoder(SAC+AE)
Stars: ✭ 94 (+683.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Deep-Reinforcement-Learning-With-Python
Master classic RL, deep RL, distributional RL, inverse RL, and more using OpenAI Gym and TensorFlow with extensive Math
Stars: ✭ 222 (+1750%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Deep Reinforcement Learning With Pytorch
PyTorch implementation of DQN, AC, ACER, A2C, A3C, PG, DDPG, TRPO, PPO, SAC, TD3 and ....
Stars: ✭ 1,345 (+11108.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch sac
PyTorch implementation of Soft Actor-Critic (SAC)
Stars: ✭ 174 (+1350%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Deeprl Tutorials
Contains high quality implementations of Deep Reinforcement Learning algorithms written in PyTorch
Stars: ✭ 748 (+6133.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Reinforcement Learning
Minimal and Clean Reinforcement Learning Examples
Stars: ✭ 2,863 (+23758.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch Drl
PyTorch implementations of various Deep Reinforcement Learning (DRL) algorithms for both single agent and multi-agent.
Stars: ✭ 233 (+1841.67%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Torch Ac
Recurrent and multi-process PyTorch implementation of deep reinforcement Actor-Critic algorithms A2C and PPO
Stars: ✭ 70 (+483.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Fruit-API
A Universal Deep Reinforcement Learning Framework
Stars: ✭ 61 (+408.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch A3c
PyTorch implementation of Asynchronous Advantage Actor Critic (A3C) from "Asynchronous Methods for Deep Reinforcement Learning".
Stars: ✭ 879 (+7225%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Hierarchical Actor Critic Hac Pytorch
PyTorch implementation of Hierarchical Actor Critic (HAC) for OpenAI gym environments
Stars: ✭ 116 (+866.67%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Rl algos
Reinforcement Learning Algorithms
Stars: ✭ 14 (+16.67%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Machine Learning Is All You Need
🔥🌟《Machine Learning 格物志》: ML + DL + RL basic codes and notes by sklearn, PyTorch, TensorFlow, Keras & the most important, from scratch!💪 This repository is ALL You Need!
Stars: ✭ 173 (+1341.67%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Dissecting Reinforcement Learning
Python code, PDFs and resources for the series of posts on Reinforcement Learning which I published on my personal blog
Stars: ✭ 512 (+4166.67%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch Rl
Deep Reinforcement Learning with pytorch & visdom
Stars: ✭ 745 (+6108.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch A2c Ppo Acktr Gail
PyTorch implementation of Advantage Actor Critic (A2C), Proximal Policy Optimization (PPO), Scalable trust-region method for deep reinforcement learning using Kronecker-factored approximation (ACKTR) and Generative Adversarial Imitation Learning (GAIL).
Stars: ✭ 2,632 (+21833.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
jax-rl
JAX implementations of core Deep RL algorithms
Stars: ✭ 61 (+408.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic

Regularflow

(The project is under construction, the document and code documentation will evolve you can ask me if you don't understand).

This module allows you to create trafic light clusters that interact together to regulate circulation. Trafic lights are smart and can take decision according to the environnement.

I use Deep-reinforcement Q learning for the first POC and Actor-Critic A3C for the next POC

Introduction

There are two types of traffic lights. Influencers and Followers. Influencers are traffic lights that train and followers are trafic lights symmetrical to their influencers. A follower will take the opposite action of an influencer. This allows the case managed two traffic lights that don't have to be green at the same time

When we create an influencer we can assign him a follower and this follower will take the opposite actions of this influencer. To create a cluster of traffic lights that communicate with each other for the regularisation of a zone it's simple. When we create a fire we give the id of the other traffic lights

Managers are fake cameras to simulate the number of cars and pedestrians on the way of a traffic light. Each traffic lights has a manager who tells him the numbers of cars and pedestrians on his way.

Depending on the numbers of cars and pedestrians the traffic lights are rewarded. Each traffic light knows the status of all the others traffic lights which are into the cluster. If a traffic light is overbooked and causes the bottling of another traffic light, traffic lights will adapt to gain the most reward and therefore regulate the traffic

You need to have Apache Kafka and Zookeper for the stream communication.

sheme

First you need to create topic's partitions :

One for Manager's communications and one for traffic lights communications

  • Download apache kafka here.

  • Install regularflow with setup :

    ./setup install

  • Start a kafka's broker and a Zookeper's server

  • Run this code in an python's interpreter

from confluent_kafka.admin import AdminClient, NewTopic

adminConfig = {
                'bootstrap.servers': 'localhost:9092'
              }

topicList = ["manager0", "cluster0", "display"]    # Topic Names
partitions = [4, 4, 4]   # Here replace the number 4 by the number of Trafic light that you want in the cluster
replications = [1, 1, 1]

if __name__ == '__main__' :
    newTopics = []
    adminClient = AdminClient(adminConfig)
    adminClient.delete_topics(topicList)
    adminClient.delete_topics(["__consumer_offsets"])
    for i in range(len(topicList)):
        newTopics.append(NewTopic(topicList[i], partitions[i] , replications[i]))
    print(newTopics)
    adminClient.create_topics(newTopics)

Example of configuration for a "follower" trafic light

from regularflow import newAgent, startDemo, startAgent

consumerConfig = {
                'bootstrap.servers': 'localhost:9092',
                'group.id': 'cluster0',
                'auto.offset.reset': 'earliest'
                }
producerConfig = {
                'bootstrap.servers': 'localhost:9092'
                 }

agent = newAgent(1, consumerConfig, producerConfig, "cluster0", "manager0","display", "follower")  # the first number is the id of the traffic light
agent._setAgents([0]) # Here type the id of the other trafic light in the cluster for the communication
startDemo(agent) # run the agent with startDemo for the non-training mode and with startAgent for the training mode

Example of configuration for a "influencer" trafic light

from regularflow import newAgent, startDemo, startAgent

consumerConfig = {
                'bootstrap.servers': 'localhost:9092',
                'group.id': 'cluster',
                'auto.offset.reset': 'earliest'
                }
producerConfig = {
                'bootstrap.servers': 'localhost:9092'
                 }


agent = newAgent(0, consumerConfig, producerConfig,"cluster0", "manager0", "display", "influencer") # the first number is the id of the traffic light
agent._setAgents([1]) # set the id of other traffic lights in the cluster for communication
agent._setForbidenAgents([1]) # set the follower's id of this influencer
agent._restore("/home/roloman/projet-perso/regularflow/example/saves/save_influencer0") # setup the path of the the saved model
startDemo(agent)  # start agent with startDemo for start with non-training mode
agent._save() # specify the save for save this traffic light

Usage example :

For an example, go in the example directory and run in differents terminals :

  • The code for initialisation topic's partitions
  • Influencer.py and Follower.py
  • Then Manager0.py and Manager1.py

You can see the training mode

Author

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].