This guide explains how to set up and run a classification federated learning system using Docker. The setup involves multiple clients and a central server, all managed via a docker.sh script.
###Instructions
####1. Setting Up Clients and Server
Execute: Use the docker.sh script to start both clients and the server: see _FIles_
Adjust Parameters: Modify the script settings as required for each client and the server.
####2. Script Configuration
**MY_DATA_DIR**
Purpose: Defines the path to the data directory.
Example Configuration:
```
MY_DATA_DIR=/home/Pictures
```
Directory Structure:
Organize your data directory as follows:
```
.
├── center01
│ ├── Train_Private
│ │ ├── 1
│ │ ├── 12
...
│ │ └── train_private.csv
│ └── Train_Public
│ ├── 14
...
│ └── train_public.csv
├── center02
...
│ ├── Train_Private
│ │ ├── 10
...
│ │ ├── 9
│ │ └── train_private.csv
│ └── Train_Public
│ ├── 16
...
│ └── train_public.csv
├── center03
│ ├── Train_Private
│ │ ├── 1
..
│ │ └── train_private.csv
│ └── Train_Public
│ ├── 106
...
│ └──train_public.csv
```
**Note:**
! To Train a Model: run the
```
prepare_data_top5.py
```
script where you need to provide
```
--root_dir 'app/data/center03/Train_Private'
```
and
```
--center 'center03'
```
**GPU2USE**
Purpose: Specifies the GPU resources to be used.
Options: All GPUs:
```
GPU2USE=all
```
Specific GPUs:
```
GPU2USE='"device=0,2"'
```
**NETARG**
Purpose: Defines network arguments for Docker containers.
Default Setting:
```
NETARG="--net=host"
```
Modification: Change this if additional network settings are needed.
**CONTAINER_NAME**
Purpose: Sets the name of the Docker container.
Configuration: For Clients: Set to the specific client name (e.g., client1, client2, etc.):
```
CONTAINER_NAME=client1
```
For Server: Set to server:
```
CONTAINER_NAME=server
```
####2. Running a server
1. Run ./docker.sh
2. Edit config_server.yaml located in ./training/src/server if needed to provide a relevant address to a server
3. Launch the server
```
python ./training/src/server/server_fl.py
```
####3. Running a client
1. Run ./docker.sh
2. Edit config_server.yaml located in ./training/src/client if needed to provide a relevant address to a server
3. Start a client n (n = 1, 2, 3)
```
python ./training/src/client/clientn.py
```
####4. Results
All results are saved as weights to _output_ folder. For example, the weights models trained on public portion of the dataset can be found here:
```
/training/output_public/models
```
Created by Julia Alekseenko ajulyav Dear Julia,
I executed your training scripts. There were successful.
Can you let me know where I can find your evaluation scripts?
BR Max