Git Product home page Git Product logo

federated-time-series-forecasting's Introduction

Federated Time-Series Forecasting

This is the code accompanying the submission to the Federated Traffic Prediction for 5G and Beyond Challenge of the Euclid team and the corresponding paper entitled "Federated Learning for 5G Base Station Traffic Forecasting" by Vasileios Perifanis, Nikolaos Pavlidis, Remous-Aris Koutsiamanis, Pavlos S. Efraimidis, 2022.


This code can serve as benchmark for federated time-series forecasting. We focus on raw LTE data and train a global federated model using the measurements of three different base stations on different time intervals. Specifically, we implement 6 different model architectures (MLP, RNN, LSTM, GRU, CNN, Dual-Attention LSTM Autoencoder) and 9 different federated aggregation algorithms (SimpleAvg, MedianAvg, FedAvg, FedProx, FedAvgM, FedNova, FedAdagrad, FedYogi, FedAdam) on a non-iid setting with distribution, quantity and temporal skew.

Installation

We recommend using a conda environment with Python 3.8

  1. First install PyTorch
$ conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
  1. Install additional dependencies
$ pip install pandas scikit_learn matplotlib seaborn colorcet scipy h5py carbontracker notebook

You can also use the requirements' specification:

$ pip install -r requirements.txt

Project Structure

.
├── dataset                 # .csv files
├──── ...
├── ml                      # Machine learning-specific scipts
├──── fl                    # Federated learning utilities
├────── client              # Client representation
├─────── ...
├────── history             # Keeps track of local and global training history
├─────── ...
├────── server              # Server Implementation
├─────── client_manager.py  # Client manager abstract representation and implementation
├─────── client_proxy.py    # Client abstract representation on the server side
├─────── server.py          # Implements the training logic of federated learning
├─────── aggregation        # Implements the aggregation function
├───────── ...
├─────── defaults.py        # Default methods for client creation and weighted metrics
├─────── client_proxy.py    # PyTorch client proxy implementation
├─────── torch_client.py    # PyTorch client implementation
├──── models                # PyTorch models
├───── ...
├──── utils                 # Utilities which are common in Centralized and FL settings
├────── data_utils.py       # Data pre-processing
├────── helpers.py          # Training helper functions
├────── train_utils.py      # Training pipeline 
├── notebooks               # Tools and utilities
└── README.md

Examples

Refer to notebooks for usage examples.

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.