Skip to content

glenn89/FederatedRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Federated Reinforcement Learning

We try to allow multiple reinforcement learning agents to learn optimal control policy on their own IoT devices of the same type but with slightly different dynamics. For such multiple IoT devices, there is no guarantee that an agent who interacts only with one IoT device and learns the optimal control policy will also control another IoT device well. Therefore, we may need to apply independent reinforcement learning to each IoT device individually, which requires a costly or time-consuming effort.

To solve this problem, we propose a new federated reinforcement learning architecture where each agent working on its independent IoT device shares their learning experience (i.e., the gradient of loss function) with each other, and transfers a mature policy model parameters into other agents. They accelerate its learning process by using mature parameters. We incorporate the Actor-Critic PPO algorithm into each agent in the proposed collaborative architecture and propose an efficient procedure for the gradient sharing and the model transfer.

We use Quanser's Qube-servo 2 as the real device. We also used CartPole from OpenAI Gym as the simulation environment.

Related Paper

  1. "Federated Reinforcement Learning for Training Control Policies on Multiple IoT Devices." Sensors 20, no. 5, 1359, 2020. (in English)
  2. "Learning Performance Improvement Using Federated Reinforcement Learning Based on Distributed Multi-Agents" in Proceedings of KICS Fall Conference 2019, November, Seoul, Korea, 2019. (in Korean)

Execute the Proposed Federated Reinforcement Learning in Simulation Environment

  • Set-up the hyper-parameter
    • modify main_constants.py in "rl_main" folder
      • ex) the number of workers, Whether or not to use the gradient sharing, Whether or not to use the transfer learning, and PPO's hyper-parameters
  • Execution
    • python main.py

Environment Configuration

1. Create Environment

2. OpenAI Gym Install

3. Package Install & requirements.txt Configuration

  • pip freeze > requirements.txt

4. Mosquitto Install

  • Mosquitto install

  • Execute the mosquitto service

    • For Mac
      • /usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
    • For Linux
      • mosquitto
  • Test the subscribe

    • mosquitto_sub -h [address] -p [port] -t [topic]
    • mosquitto_sub -h 127.0.0.1 -p 1883 -t "topic"
  • Test the publication

    • mosquitto_pub -h [address] -p [port] -t [topic] -m [content]
    • mosquitto_pub -h 127.0.0.1 -p 1883 -t "topic" -m "test messgae"

5. Execution

  • Execute chief
    • python main_only_chief.py
  • Execute worker
    • python main_only_one_worker.py
  • Execute main for the test
    • OpenAI Gym CartPole
    • python main.py

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages