GithubHelp home page GithubHelp logo

safi's Introduction

SAFI

Implementation of federated learning on real-world setting in Java.

Overview

We implement a real-world federated learning project based on Java. There are one server and many clients to collaboratively train a model. We use DL4J as the deep learning library. The data we use is a Human Activity Recognition (HAR) dataset.

Server-side

main
└─ java
       ├─ baselinemodel.java
       └─ server
              ├─ FederatedModel.java
              ├─ FileServer.java
              └─ ServerConnection.java

The base model is a MLP composed of one input layer, one output layer and one hidden layer with 1000 units using ReLU activation. The model can be changed in FederatedModel.java.

FileServer.java is the main file to start the server, after running this file, a FL server is started. FederatedModel.java is used to initialize FL model, define the FL aggregation strategy, and evaluate the model. ServerConnection.java is incharge of network connection, which can be kept without changing.

Client-side

main
└─ java
       ├─ FileClient.java
       ├─ MultiClients.java
       └─ localUpdate.java

FileClient.java is used to create a FL client. In the main function, make sure to set the server IP to make sure the client can connect to the server. localUpdate.java is used to input the data and train the model.

Communication

Considering there are no enough client devices to do experiments, we use java multithreading to simulate the real clients, for example, run 100 threads in one device. If you have the many real devices, the project also works.

Reference

https://github.com/Cautiousss/federated-learning

safi's People

Contributors

boyufan avatar

Watchers

 avatar

Forkers

souvikpaul01

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.