Bulid your First Project
The section will show you how to build your first federated pruning project in distributed version in FedPruning.
Make the Basic Structure
Your project should have the following directories and files, organized under your project name:
- experiments \
- distributed \
- [project_name] \
- main.py # Main script to execute the project
- run.sh # Bash script to run the code
- gpu_mapping.yaml # GPU allocation for processes
- README.md # Documentation for your project
- api \
- distributed \
- [project_name] \
- API.py # High-level control for server and clients
- ServerManager.py # Manages server behavior, handles messages
- Aggregator.py # Manages the aggregation function
- ClientManager.py # Manages client behavior, handles messages
- Trainer.py # High-level trainer control for clients
- message_define.py # Defines message types
- utils.py # Utility functions and tools
- standalone \
- [project_name] \
- my_model_trainer_classification.py # Low-level trainer for clients (classification tasks)Some Useful API
This section introduces some important APIs to help you build your own project.
Dataset
The api/data_preprocessing/ directory contains functions for processing all supported datasets.
Pruning
The api/pruning/ directory provides implementations for model pruning and mask adjustments.
Model
The api/model/ directory contains implementations for models designed for various tasks and scenarios.
Last updated