/federated-learning-with-grpc-docker

A simple application that uses docker and gRPC to demonstrate fedrated learning

Primary LanguagePython

Federated Learning with gRPC and Docker

A simple application that uses docker and gRPC to demonstrate fedrated learning

What is Federated Learning?

Standard machine learning approaches require centralizing the training data on one machine or in a datacenter. And Google has built one of the most secure and robust cloud infrastructures for processing this data to make our services better. Now for models trained from user interaction with mobile devices, Google is introducing an additional approach: Federated Learning.

Federated Learning enables mobile phones to collaboratively learn a shared prediction model while keeping all the training data on device, decoupling the ability to do machine learning from the need to store the data in the cloud. This goes beyond the use of local models that make predictions on mobile devices (like the Mobile Vision API and On-Device Smart Reply) by bringing model training to the device as well.

source

What's in this repo?

This repo consist of a simple python application that makes use of gRPC and Docker to demonstrate how Federated Learning (kinda) works.

Here's a visualization of the architecture of our application

Setup

Make sure you have python3, docker and docker-compose setup on your machine.

Getting started

Start the nodes by running the following commands

$ cd /node
$ docker-compose up --build

You should now have a terminal with the logs from all the nodes in this distributed system.

Open another terminal and run the following commands

$ cd /interface
$ python3 client.py

You should now have a terminal with an interactive menu to play aroud with!