- main.py: the main function for all experiments;
- hyper_model/models.py: this script defines all necessary model structures;
- solvers: this script implements two different optimization for learning the whole Pareto Front (linear and EPO);
- train.py: this script defines the train function for all experiments (including evaluation, saving model, loading model, etc.);
- utils/utils_data.py: this script pre-processes all data set which will be used for the following training and evaluating;
- utils/utils_func.py: the needed extra functions;
- utils/utils_sampling.py: this script is used for generating non i.i.d data for all experiments.
python 3.6, the needed environment libraries are in requirements.txt
conda create -n E8519 python=3.6
conda install --yes --file requirements.txt
- Synthetic data set the source code will generate the needed data when running the synthetic experiments
- Adult data set Adult data set is pre-processed following the work in [1,2] the processed data set is in data/Adult
- CIFAR10 We download CIFAR10 when firstly running the CIFAR10 experiments and the downloaded data will be saved in data/CIFAR10
- eICU eICU dataset needs approval when researchers need to have access to it.
- dataset: the needed dataset for running experiments;
- trainN: the generated synthetic data samples for training;
- std: the
$\rho$ when generating synthetic data; - sample_ray: whether we need to sample direction vectors
$d$ for training the Pareto Front of all objectives; - target_usr: the target client where the learned personalized model will deploy;
- total_hnet_epoch: the num of epoch for training the Pareto Front;
- total_ray_epoch: the num of epoch for training the direction vector
$d$ - lr: learning rate for updating the hypernetwork;
- lr_prefer: learning rate for updating the direction vector
$d$ ; - gpus: the GPU device;
- n_hidden: the num of hidden layers of the hypernetwork;
- num_users: the num of clients in each experiment
python main.py --dataset synthetic --trainN 2000 --std 0.1 --sample_ray --target_dir synthetic --target_usr 4 --total_hnet_epoch 1000 --epochs_per_valid 1 --total_ray_epoch 200 --total_epoch 1 --gpus 0 --n_hidden 1 --lr 0.01 --lr_prefer 0.01 --seed 1 --solver_type linear
python main.py --dataset adult --target_dir adult --target_usr 0 --total_hnet_epoch 20 --epochs_per_valid 100 --total_ray_epoch 1 --total_epoch 2000 --gpus 0 --n_hidden 3 --lr 0.05 --lr_prefer 0.01 --seed 0 --solver_type epo
python main.py --dataset cifar10 --num_users 10 --target_usr 9 --total_hnet_epoch 10000 --total_ray_epoch 1000 --total_epoch 1 --seed 3 --local_bs 512 --lr 0.01 --lr_prefer 0.01 --solver_type linear --sample_ray --n_hidden 3 --embedding_dim 5 --input_dim 20 --output_dim 2 --hidden_dim 100 --gpus 0
[1] Tian Li, Maziar Sanjabi, Ahmad Beirami, and Virginia Smith. Fair resource allocation in federated learning.429arXiv preprint arXiv:1905.10497, 2019 [2] Mehryar Mohri, Gary Sivek, and Ananda Theertha Suresh. Agnostic federated learning. InInternational431Conference on Machine Learning, pages 4615–4625. PMLR, 2019.