Skip to main content

Federated Learning research framework in your mind

Project description

FedMind

A simple and easy Federated Learning framework fit researchers' mind based on PyTorch.

Unlike other popular FL frameworks focusing on production, FedMind is designed for researchers to easily implement their own FL algorithms and experiments. It provides a simple and flexible interface to implement FL algorithms and experiments.

Installation

The package is published on PyPI under the name fedmind. You can install it with pip:

pip install fedmind

Usage

A configuration file in yaml is required to run the experiments. You can refer to the config.yaml as an example.

There are examples in the examples directory.

Make a copy of both the config.yaml and fedavg_demo.py to your own directory. You can run them with the following command:

python fedavg_demo.py

Here we recommend you to use the UV as a python environment manager to create a clean environment for the experiments.

After install uv, you can create a new environment and run a FedMind example with the following command:

uv init FL-demo
cd FL-demo
source .uv/bin/activate

uv add fedmind torchvision
wget https://raw.githubusercontent.com/Xiao-Chenguang/FedMind/refs/heads/main/examples/fedavg_demo.py
wget https://raw.githubusercontent.com/Xiao-Chenguang/FedMind/refs/heads/main/config.yaml

uv run python fedavg_demo.py

Features

This FL framework provides two client simulation modes depending on your resources:

  • Parallel training speed up for powerful resources.
  • Serialization for limited resources.

This is controlled by the parameter NUM_PROCESS which can be set in the config.yaml. Setting NUM_PROCESS to 0 will use the serialization mode where each client trains sequentially in same global round. Setting NUM_PROCESS > 0 will use the parallel mode where NUM_PROCESS workers consume the clients tasks in parallel. The recommended value for NUM_PROCESS is the number of CPU cores available.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fedmind-0.1.3.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fedmind-0.1.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file fedmind-0.1.3.tar.gz.

File metadata

  • Download URL: fedmind-0.1.3.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for fedmind-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7d0bbf33823db28fb61cc4b159991af6ea40b32a5755e2204b7a4cf7291f98d6
MD5 a34c2b90aee97f1c5c81e316fee1a2e9
BLAKE2b-256 4da2949f01794347a0903a5a9bc25d336408885d5a4d67fd2364e4de01c89db0

See more details on using hashes here.

File details

Details for the file fedmind-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fedmind-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for fedmind-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cd0ecb52216a973ad32c3332c60c459e7591eeb8cc1051fda4289fa0c75e7f19
MD5 f8a30c5c5152a9f862e5cd9c6079e7cd
BLAKE2b-256 7080f3355d28436f8e73eea5118853dce702f988fd7d9c23a6b3553ed003f953

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page