Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.11 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.11 KB

Federated Learning simulation

Simulation of a Federated Learning scenario using Tensorflow Federated and a federated version of MNIST dataset. This source code is the result of following several workshops and tutorials about Tensorflow Federated. The goal is to modularize a bit the code used with Tensorflow Federated, but because of the annotations of the framework, that's been a hard task.

Installation

Just install python 3.8 along nest_asyncio and Tensorflow Federated.

pip install --quiet --upgrade tensorflow_federated
pip install --quiet --upgrade nest_asyncio

Run the simulation

cd src
python simulation.py

Changing configuration

At src/simulation.py line 10, change the values of these parameters:

num_clients=10, batch_size=20, rounds=100 

The most important argument is the rounds. More rounds will give more accuracy of the trained model. You'll be able to see the result printed in the standard output.

2042/2042 [==============================] - 16s 8ms/step - loss: 1.5411 - sparse_categorical_accuracy: 0.6575

Process finished with exit code 0