Skip to main content

Research Libary for Federated Learing Loss Landscapes

Project description

Fedland: Loss Landscapes in Federated Learning

Summary:

Loss landscapes in the federated learning [1] setting are relatively more complex and often fragmented as compared to the centralized setting, owing to variations in local data distributions [2]. The project will study and contrast local and global loss landscapes to derive insights about a local client’s contribution to the overall loss landscape. Understanding these dynamics can potentially enhance our ability to optimize federated learning systems.

Task:

  • Training a neural network model in two settings:

    1. In a centralized environment
    2. In a federated environment, including:
      • Balanced/unbalanced
      • IID/non-IID
  • Conduct experiments with the federated setting focusing on analyzing the loss landscapes of the models trained in these settings, including both the global model and individual client-side local models.

Project Layout:

Since I am using FEDn, the project follows their recommended project structure.

I have added pyproject.toml for managing our dependencies. I have written it to use Poetry. You probably want to use an virtual environment or tool to manage your virtualenv. To install the dependencies using poetry, simply run poetry install. I set it to use python 3.11

project
├ client
│ ├ fedn.yaml
│ ├ python_env.yaml
│ ├ model.py
│ ├ data.py
│ ├ train.py
│ └ validate.py
├ data
│ └ mnist.npz
├ fedland (module)
│ └ __init__.py
├ README.md
├ pyproject.toml
├ scripts / notebooks
├ compose.yaml
└ Dockerfile

What is /fedland?

The idea behind writing fedland into its own package is it would abstract repetitive calculatations and functionality into a tiny library available on PyPi in order to pull it into clients environments.

In the future it may include logging everything to a centralized store (like mongo since it's already there). This way anyone who wants to run tests can all log their experiments to the same place and make sure calculations and data processing are consistent across experiments.

if you just want to use fedland metrics and such (its pretty bare rn) instal with pip install fedland

Running the project

In docker:

cd fedland
docker compose up --build -d

Locally (plus with FEDn Studio)

  1. Setup a venv
  2. Run poetry install in venv
  3. Create and fill in the .env fields based on .env.example
    • run: cp .env.example .env
  4. Run whatever scripts you want in /scripts
    • eg: python scripts/centralized_base.py

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

fedland-0.1.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

fedland-0.1.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file fedland-0.1.2.tar.gz.

File metadata

  • Download URL: fedland-0.1.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.3-arch1-1

File hashes

Hashes for fedland-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f0ec18f34036bea42dfe927d2e1f0089347c5815c7deaa0b6b098d6a3ef0addb
MD5 9d7cf8244b738a26882392ab07820d5c
BLAKE2b-256 7fd54d6c7b36a82ce3d44255010904e6f8973b2c2ec9880c781f7c38c83b7e39

See more details on using hashes here.

File details

Details for the file fedland-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fedland-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.3-arch1-1

File hashes

Hashes for fedland-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 79745b8f5b6ec5a6d60a3be90840082fe0896d5a9c8de8111fcaecbff35cfbed
MD5 05f4d1fbcf634c5325f6b36fcb1a1aba
BLAKE2b-256 faf88795f2ba0a474cb582546dad1d1a9e4ce234ec383ea5b631074925afac5a

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