How layer6ai-labs/proxyfl works
Main Components
• Experiment Orchestrator: Represented by the main experiment scripts (run_exp.py and run_exp.sh) that drive the workflow.
• Data Management: A shell script (download_data.sh) is responsible for fetching the necessary datasets.
• Client (Local Training) Process: The client.py file likely initializes or interacts with decentralized client processes, which participate in the federated learning setup.
• Model Definition: The model.py file contains the neural network architecture used in the training.
• Training Module: The trainer.py script likely encapsulates the training routines, including local updates and proxy model sharing.
• Privacy Verification: The privacy_checker.py module integrates privacy techniques (potentially by using opacus) to ensure that differentially private constraints are met.
• Utility Functions: The utils.py file provides supportive functions which might be used across various components (data pre-processing, logging, etc.).
• Visualization: The plot.py module is used to generate visualizations of training results or performance metrics.
Detail Relationships and Interactions
• Data Flow: Begin with the data acquisition (download_data.sh) feeding data into the experiment scripts. Data is then preprocessed and passed along to the client modules.
• Client-Server (or Peer-to-Peer) Relationships: In decentralized federated learning, every client (initialized in client.py) carries out local model training (using trainer.py and model.py), and then shares a “proxy” version of its model with other peers.
• Privacy Integration: As models are shared, privacy_checker.py provides validations that the shared models conform to privacy standards.
Architectural Patterns and Technologies
• Decentralized Federated Learning: The system is organized in a peer-to-peer or decentralized fashion where every client participates in local training and then shares a proxy model.
• Modularity: The project’s separation into distinct scripts for training, client handling, privacy checking, and visualization shows a modular design.
• Use of Modern ML Libraries: PyTorch for model training, opacus for privacy, and mpi4py for communication are key technologies that underpin the system.
• Experiment-Driven: The presence of shell scripts to run experiments and download data emphasizes a research and experimental usage pattern.