MCPcopy Index your code
hub / github.com/akhilmathurs/orchestra

github.com/akhilmathurs/orchestra @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
161 symbols 475 edges 13 files 4 documented · 2% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Orchestra: Unsupervised Federated Learning via Globally Consistent Clustering

Codebase for the paper "Orchestra: Unsupervised Federated Learning via Globally Consistent Clustering."

Contains federated training with several unsupervised methods, including the proposed method Orchestra, SimCLR, SimSiam, SpecLoss, BYOL, and Rotation Prediction; supports linear evaluation protocol; semi-supervised evaluation protocol; and hyperparameter tuning via the alignment-uniformity scheme discussed in the paper.

Requirements

The code requires:

  • Python 3.6 or higher

  • Pytorch 1.9 or higher

We use the Flower federated learing framework for all client-server implementation. Flower and other dependencies can be installed via following command:

pip -r install requirements.txt

Example execution

First use the following command to setup the dataset of your choice (e.g., CIFAR-10) for any number of clients (e.g., 100) and heterogeneity (e.g., 0.1 as Dirichlet distribution parameter):

python sampler.py --dataset="CIFAR10" --n_clients=100 --alpha=0.1

Then, to train a model using a particular training method and perform linear eval, run the following command

python main.py --config_dict="{'train_mode': 'orchestra', 'da_method': 'orchestra', 'local_lr': 0.003}" --do_linear=True

Other execution examples (semi-supervised training and hyperparameter tuning) are provided in the examples.sh file.

Organization

-- Support files

  • myfedavg.py: Manually defined Federated Averaging protocol to allow support server-level manipulation of the global model

  • config.py: Contains a dict that defines all hyperparameters for federated training and GPU management.

  • sampler.py: Splits the dataset into predefined number of clients.

  • utils.py: Dataloaders, test functions, progress bars

-- Federated training and Self-supervised learning

  • server.py: Server module; manages clients and records global progress.

  • client.py: Client module; contains client-specific functions (e.g., unsupervised training protocol)

  • models.py: All backbone and SSL function definitions (includes Orchestra, SimCLR, SimSiam, SpecLoss, BYOL), Rotation Prediction)

-- Evaluation protocols

  • linear_eval.py: Linear evaluation protocol

  • semisup_eval.py: Semi-supervised evaluation protocol

-- Hyperparameter tuning

  • hparam_method.py: Implemented the unsupervised hyperparameter tuning protocol

  • hparam_parser.py: Parses and evaluates one single point on the hyperparameter grid

  • hparam_main.py: Main execution file for hyperparameter tuning that evaluates each grid point

Core symbols most depended-on inside this repo

create_backbone
called by 12
models.py
step
called by 8
utils.py
_make_layer
called by 4
models.py
get_config_dict
called by 3
config.py
_make_layer
called by 3
models.py
get_block
called by 3
models.py
update_run_id
called by 3
hparam_main.py
get_eval_dict
called by 2
config.py

Shape

Method 83
Function 45
Class 33

Languages

Python100%

Modules by API surface

models.py78 symbols
utils.py45 symbols
client.py11 symbols
server.py6 symbols
myfedavg.py4 symbols
semisup_eval.py3 symbols
main.py3 symbols
hparam_parser.py3 symbols
hparam_main.py3 symbols
hparam_method.py2 symbols
config.py2 symbols
linear_eval.py1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add orchestra \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact