-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_fedprox.sh
executable file
·111 lines (101 loc) · 4.84 KB
/
run_fedprox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
# trap "exit" INT
trap 'kill $(jobs -p)' EXIT
g=${1?:-8}
data=${2?:-cifar100}
align=${3:-add_fake_diffusion_sync_local_generator_without_shuffle}
v_g=${4:-30}
n_devices=${5:-10}
loc=${6:-nobackup}
beta=${7:-0.01}
beta=0.01
if [ "$data" == cifar10 ]; then
lr=0.05
else
lr=0.1
fi
if [ "$n_devices" == 10 ]; then
if [ "$align" == none ]; then
for s_v in $v_g
do
./run_diff_gen.sh 0.01 "$s_v" "$lr" fed_prox 0 10 VGG_11 0 10 0 "$g" "$data" "$align" 0 0 10 train_im 0 0 0 0 0 "$loc" "$beta"
./run_diff_gen.sh 0.1 "$s_v" "$lr" fed_prox 0 10 VGG_11 0 10 0 "$g" "$data" "$align" 0 0 10 train_im 0 0 0 0 0 "$loc" "$beta"
done
elif [ "$align" == add_fake_diffusion_sync_local_generator ] || [ "$align" == add_fake_diffusion_sync_local_generator_without_shuffle ]; then
for s_v in $v_g
do
./run_diff_gen.sh 0.01 "$s_v" 0.1 fed_prox 0 10 VGG_11 0 10 0 8 "$data" "$align" 1 101 10 train_im 5000 3375 450 2 0 "$loc" "$beta"
./run_diff_gen.sh 0.1 "$s_v" 0.1 fed_prox 0 10 VGG_11 0 10 0 8 "$data" "$align" 1 101 10 train_im 5000 3375 450 2 0 "$loc" "$beta"
done
fi
elif [ "$n_devices" == 4 ]; then
if [ "$align" == none ]; then
for s_v in $v_g
do
./multi_version_subsample_brun.sh 0.01 "$s_v" "$lr" fed_prox 0 10 VGG_11 0 10 "$g" 8 "$data" \
"$align" 0.4 0 10 train_im 0 0 0 "$beta" false 0 0 4 "$loc" 0
./multi_version_subsample_brun.sh 0.1 "$s_v" "$lr" fed_prox 0 10 VGG_11 0 10 "$g" 8 "$data" \
"$align" 0.4 0 10 train_im 0 0 0 "$beta" false 0 0 4 "$loc" 0
done
elif [ "$align" == add_fake_diffusion_sync_local_generator ] || [ "$align" == add_fake_diffusion_sync_local_generator_without_shuffle ]; then
for s_v in $v_g
do
./multi_version_subsample_brun.sh 0.01 "$s_v" 0.1 fed_prox 0 10 VGG_11 0 10 "$g" 8 "$data" \
"$align" 0.4 101 10 train_im 5000 3375 0 "$beta" false 450 2 4 "$loc" 0
./multi_version_subsample_brun.sh 0.1 "$s_v" 0.1 fed_prox 0 10 VGG_11 0 10 "$g" 8 "$data" \
"$align" 0.4 101 10 train_im 5000 3375 0 "$beta" false 450 2 4 "$loc" 0
done
fi
elif [ "$n_devices" == 40 ]; then
if [ "$data" == cifar10 ]; then
loc_epoch=30
s_epoch=450
elif [ "$data" == cifar100 ]; then
loc_epoch=40
s_epoch=499
fi
if [ "$align" == none ]; then
for s_v in $v_g
do
./multi_version_subsample_brun.sh 0.01 "$s_v" "$lr" fed_prox 0 "$loc_epoch" VGG_11 0 40 "$g" 8 "$data" \
none 0.2 0 10 train_im 0 0 0 "$beta" false 0 0 8 "$loc" 0
./multi_version_subsample_brun.sh 0.1 "$s_v" "$lr" fed_prox 0 "$loc_epoch" VGG_11 0 40 "$g" 8 "$data" \
none 0.2 0 10 train_im 0 0 0 "$beta" false 0 0 8 "$loc" 0
done
elif [ "$align" == add_fake_diffusion_sync_local_generator ] || [ "$align" == add_fake_diffusion_sync_local_generator_without_shuffle ]; then
for s_v in $v_g
do
./multi_version_subsample_brun.sh 0.01 "$s_v" 0.1 fed_prox 0 "$loc_epoch" VGG_11 0 40 "$g" 8 "$data" \
"$align" 0.2 101 10 train_im 1125 845 0 "$beta" false "$s_epoch" 2 8 "$loc" 0
./multi_version_subsample_brun.sh 0.1 "$s_v" 0.1 fed_prox 0 "$loc_epoch" VGG_11 0 40 "$g" 8 "$data" \
"$align" 0.2 101 10 train_im 1125 845 0 "$beta" false "$s_epoch" 2 8 "$loc" 0
done
fi
elif [ "$n_devices" == 100 ]; then
if [ "$data" == cifar10 ]; then
loc_epoch=30
s_epoch=499
num_im=500
elif [ "$data" == cifar100 ]; then
loc_epoch=40
s_epoch=499
num_im=1000
fi
if [ "$align" == none ]; then
for s_v in $v_g
do
./multi_version_subsample_brun.sh 0.01 "$s_v" "$lr" fed_prox 0 "$loc_epoch" VGG_11 0 100 "$g" 8 "$data" \
none 0.1 0 10 train_im 0 0 0 "$beta" false 0 0 10 "$loc" 0
./multi_version_subsample_brun.sh 0.1 "$s_v" "$lr" fed_prox 0 "$loc_epoch" VGG_11 0 100 "$g" 8 "$data" \
none 0.1 0 10 train_im 0 0 0 "$beta" false 0 0 10 "$loc" 0
done
elif [ "$align" == add_fake_diffusion_sync_local_generator_without_shuffle ] || [ "$align" == add_fake_diffusion_sync_local_generator ]; then
for s_v in $v_g
do
./multi_version_subsample_brun.sh 0.01 "$s_v" "$lr" fed_prox 0 "$loc_epoch" VGG_11 0 100 "$g" 8 "$data" \
"$align" 0.1 101 10 train_im "$num_im" 385 0 "$beta" false "$s_epoch" 3 10 "$loc" 0
./multi_version_subsample_brun.sh 0.1 "$s_v" 0.1 fed_prox 0 "$loc_epoch" VGG_11 0 100 "$g" 8 "$data" \
"$align" 0.1 101 10 train_im "$num_im" 385 0 "$beta" false "$s_epoch" 3 10 "$loc" 0
done
fi
fi