Federated-Learning-in-PyTorch  by vaseline555

PyTorch implementations of federated learning algorithms for research

Created 4 years ago
457 stars

Top 66.1% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a comprehensive PyTorch implementation of various Federated Learning (FL) algorithms, designed to facilitate research and experimentation. It supports a wide range of datasets, models, and statistical heterogeneity simulations, making it a valuable tool for researchers in distributed machine learning.

How It Works

The framework offers a flexible architecture for implementing FL algorithms. It supports automatic downloading and preprocessing of datasets from torchvision, torchtext, and the LEAF benchmark, simplifying experimental setup. The implementation allows for various statistical heterogeneity simulations, including IID, unbalanced, and Dirichlet-based non-IID distributions, crucial for realistic FL scenarios. A diverse selection of models, from simple logistic regression to complex CNNs and Transformers, are integrated, along with popular FL algorithms like FedAvg, FedProx, and FedOpt variants.

Quick Start & Requirements

  • Install dependencies from requirements.txt. A dedicated environment (conda or Docker) is recommended.
  • Ensure PyTorch and related packages (torchvision, torchaudio, torchtext) are compatible versions. Example: conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 torchtext==0.13.0 cudatoolkit=11.6 -c pytorch -c conda-forge.
  • Configuration and example commands are available via python3 main.py -h and the commands directory.
  • Official PyTorch installation guide: https://pytorch.org/get-started/locally/

Highlighted Details

  • Supports a broad spectrum of datasets, including image, text, tabular, and temporal data, with automatic downloading.
  • Implements multiple statistical heterogeneity simulation methods for realistic FL research.
  • Integrates a wide array of models, from simple linear models to advanced architectures like MobileViT and DistilBERT.
  • Offers various FL algorithms, including FedAvg, FedProx, and adaptive optimization methods (FedAdam, FedYogi).

Maintenance & Community

Feedback is encouraged via the GitHub issue tab.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Users should verify licensing for commercial or closed-source integration.

Limitations & Caveats

The project is geared towards research and may require further adaptation for production environments. Some FL algorithms and lightweight models for cross-device settings are listed as future work.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.