Giter Site home page Giter Site logo

r-gg / flower-async Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 112 KB

Implementation of asynchronous federated learning in flower.

License: Apache License 2.0

Python 100.00%
asynchronous-federated-learning distributed-machine-learning federated-learning flower-framework online-learning

flower-async's Introduction

flower-async

Implementation of asynchronous federated learning in flower currently being developed as a part of my master's thesis.

Currently offers the following modes of operation:

  • Unweighted - Upon each merge into the global model, the local updates and global model are weighted equally.
  • FedAsync - global_new = (1-alpha) * global_old + alpha * local_new
    • Where alpha depends on the staleness and/or number of samples used
  • AsyncFedED - global_new = global_old + $\eta$ * (local_new - global_old)
    • $\eta$ again depends on staleness and/or number of samples

Implementation

The implementation consists of a modified server, strategy and client manager.

The inspiration of this work stems from the following papers:

Usage

Use the server as typical flower server with one additional argument:

  • async_strategy - currently only responsible for aggregating the models.

Moreover the async client manager should be used instead of the SimpleClientManager.

The server instantiation would hence look something like this:

server = AsyncServer(
    strategy=FedAvg(<customized>), 
    client_manager=AsyncClientManager(), 
    async_strategy=AsynchronousStrategy(<customized>))

flower-async's People

Contributors

r-gg avatar

Stargazers

Sarang S avatar Antonio Jesús Chaves avatar  avatar  avatar

Watchers

 avatar

flower-async's Issues

Usage with `flwr[simulation]`

I am trying to get flower-async running in the simulation mode. After a bit of tinkering, I am stuck with the following error.

INFO : Sampling failed: number of available free clients (1) is less than number of requested free clients (2).

log(INFO, "Initializing global parameters")
self.parameters = self._get_initial_parameters(timeout=timeout)
log(INFO, "Evaluating initial parameters")
res = self.strategy.evaluate(0, parameters=self.parameters)

As I understand it, it is due to the client not getting freed after being sampled for the initial parameters.
Any insight into how to fix the same / Have you gotten the simulation running?
Do I need to write a custom simulation class to get it working?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.