From 6d315f2a78e3d1b2746d1d1549d70a4654026c07 Mon Sep 17 00:00:00 2001
From: Erick Lavoie <erick.lavoie@epfl.ch>
Date: Wed, 8 Sep 2021 10:40:54 +0200
Subject: [PATCH] Added experiments

---
 .../cifar10/1-node-iid/experiments.sh         | 37 ++++++++++++++++
 .../greedy-swap-fc/non-iid/experiments.sh     | 43 +++++++++++++++++++
 .../greedy-swap-ring/non-iid/experiments.sh   | 43 +++++++++++++++++++
 .../fully-connected/non-iid/experiments.sh    |  8 ++--
 .../fully-connected/non-iid/experiments.sh    | 35 +++++++++++++++
 5 files changed, 163 insertions(+), 3 deletions(-)
 create mode 100755 results-v2/google-fl/cifar10/1-node-iid/experiments.sh
 create mode 100755 results-v2/google-fl/cifar10/d-cliques/greedy-swap-fc/non-iid/experiments.sh
 create mode 100755 results-v2/google-fl/cifar10/d-cliques/greedy-swap-ring/non-iid/experiments.sh
 create mode 100755 results-v2/google-fl/mnist/fully-connected/non-iid/experiments.sh

diff --git a/results-v2/google-fl/cifar10/1-node-iid/experiments.sh b/results-v2/google-fl/cifar10/1-node-iid/experiments.sh
new file mode 100755
index 0000000..ea603c0
--- /dev/null
+++ b/results-v2/google-fl/cifar10/1-node-iid/experiments.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/../../../$(cat $SCRIPT_DIR/../../../toolspath); cd $TOOLS
+
+# Add current working directory to executable namespace
+export PATH=$PATH:$TOOLS
+# Setup root directory for resolution of imports:
+# the path of all local python libraries are relative to this
+export PYTHONPATH=$TOOLS
+
+# Each command outputs the run directory, which is then used
+# by the next command to add parameters and generate information
+# used by the simulator. For a list of available options for each
+# command, run 'export PYTHONPATH=.; <command> --help'.
+setup/meta.py \
+  --results-directory $SCRIPT_DIR/all \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+setup/nodes/google-fl.py \
+  --nb-nodes 1 \
+  --local-shards 1 \
+  --shard-size 45000 |
+setup/topology/fully-connected.py |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 2000 \
+  --learning-momentum 0.9 \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --skip-testing\
+  --nb-processes 1 |
+simulate/run.py \
+  --nb-epochs 100
diff --git a/results-v2/google-fl/cifar10/d-cliques/greedy-swap-fc/non-iid/experiments.sh b/results-v2/google-fl/cifar10/d-cliques/greedy-swap-fc/non-iid/experiments.sh
new file mode 100755
index 0000000..2dc96a2
--- /dev/null
+++ b/results-v2/google-fl/cifar10/d-cliques/greedy-swap-fc/non-iid/experiments.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/../../../../../$(cat $SCRIPT_DIR/../../../../../toolspath); cd $TOOLS
+
+# Add current working directory to executable namespace
+export PATH=$PATH:$TOOLS
+# Setup root directory for resolution of imports:
+# the path of all local python libraries are relative to this
+export PYTHONPATH=$TOOLS
+
+# Each command outputs the run directory, which is then used
+# by the next command to add parameters and generate information
+# used by the simulator. For a list of available options for each
+# command, run 'export PYTHONPATH=.; <command> --help'.
+for MS in 5 10 20; do
+    setup/meta.py \
+      --results-directory $SCRIPT_DIR/all \
+      --seed 1 |
+    setup/dataset.py \
+      --name cifar10 \
+      --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+    setup/nodes/google-fl.py \
+      --nb-nodes 100 \
+      --local-shards 2 \
+      --shard-size 250 |
+    setup/topology/d_cliques/greedy_swap.py \
+      --interclique fully-connected \
+      --max-clique-size $MS \
+      --max-steps 1000 |
+    setup/model/gn_lenet.py |
+    simulate/algorithm/d_sgd.py \
+      --batch-size 20 \
+      --learning-momentum 0.9 \
+      --learning-rate 0.002 \
+      --clique-gradient |
+    simulate/logger.py \
+      --accuracy-logging-interval 10\
+      --skip-testing\
+      --nb-processes 4 |
+    simulate/run.py \
+      --nb-epochs 100;
+done
diff --git a/results-v2/google-fl/cifar10/d-cliques/greedy-swap-ring/non-iid/experiments.sh b/results-v2/google-fl/cifar10/d-cliques/greedy-swap-ring/non-iid/experiments.sh
new file mode 100755
index 0000000..ac915b9
--- /dev/null
+++ b/results-v2/google-fl/cifar10/d-cliques/greedy-swap-ring/non-iid/experiments.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/../../../../../$(cat $SCRIPT_DIR/../../../../../toolspath); cd $TOOLS
+
+# Add current working directory to executable namespace
+export PATH=$PATH:$TOOLS
+# Setup root directory for resolution of imports:
+# the path of all local python libraries are relative to this
+export PYTHONPATH=$TOOLS
+
+# Each command outputs the run directory, which is then used
+# by the next command to add parameters and generate information
+# used by the simulator. For a list of available options for each
+# command, run 'export PYTHONPATH=.; <command> --help'.
+for MS in 5 10 20; do
+    setup/meta.py \
+      --results-directory $SCRIPT_DIR/all \
+      --seed 1 |
+    setup/dataset.py \
+      --name cifar10 \
+      --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+    setup/nodes/google-fl.py \
+      --nb-nodes 100 \
+      --local-shards 2 \
+      --shard-size 250 |
+    setup/topology/d_cliques/greedy_swap.py \
+      --interclique ring \
+      --max-clique-size $MS \
+      --max-steps 1000 |
+    setup/model/gn_lenet.py |
+    simulate/algorithm/d_sgd.py \
+      --batch-size 20 \
+      --learning-momentum 0.9 \
+      --learning-rate 0.002 \
+      --clique-gradient |
+    simulate/logger.py \
+      --accuracy-logging-interval 10\
+      --skip-testing\
+      --nb-processes 4 |
+    simulate/run.py \
+      --nb-epochs 100;
+done
diff --git a/results-v2/google-fl/cifar10/fully-connected/non-iid/experiments.sh b/results-v2/google-fl/cifar10/fully-connected/non-iid/experiments.sh
index e67f375..7d4ad51 100755
--- a/results-v2/google-fl/cifar10/fully-connected/non-iid/experiments.sh
+++ b/results-v2/google-fl/cifar10/fully-connected/non-iid/experiments.sh
@@ -17,11 +17,12 @@ setup/meta.py \
   --results-directory $SCRIPT_DIR/all \
   --seed 1 |
 setup/dataset.py \
-  --name cifar10 |
+  --name cifar10 \
+  --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
 setup/nodes/google-fl.py \
   --nb-nodes 100 \
   --local-shards 2 \
-  --shard-size 200 |
+  --shard-size 225 |
 setup/topology/fully-connected.py |
 setup/model/gn_lenet.py |
 simulate/algorithm/d_sgd.py \
@@ -30,6 +31,7 @@ simulate/algorithm/d_sgd.py \
   --learning-rate 0.002 |
 simulate/logger.py \
   --accuracy-logging-interval 10\
-  --nb-processes 4 |
+  --skip-testing\
+  --nb-processes 2 |
 simulate/run.py \
   --nb-epochs 100
diff --git a/results-v2/google-fl/mnist/fully-connected/non-iid/experiments.sh b/results-v2/google-fl/mnist/fully-connected/non-iid/experiments.sh
new file mode 100755
index 0000000..f59a923
--- /dev/null
+++ b/results-v2/google-fl/mnist/fully-connected/non-iid/experiments.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/../../../../$(cat $SCRIPT_DIR/../../../../toolspath); cd $TOOLS
+
+# Add current working directory to executable namespace
+export PATH=$PATH:$TOOLS
+# Setup root directory for resolution of imports:
+# the path of all local python libraries are relative to this
+export PYTHONPATH=$TOOLS
+
+# Each command outputs the run directory, which is then used
+# by the next command to add parameters and generate information
+# used by the simulator. For a list of available options for each
+# command, run 'export PYTHONPATH=.; <command> --help'.
+setup/meta.py \
+  --results-directory $SCRIPT_DIR/all \
+  --seed 1 |
+setup/dataset.py \
+  --name mnist |
+setup/nodes/google-fl.py \
+  --nb-nodes 100 \
+  --local-shards 2 \
+  --shard-size 250 |
+setup/topology/fully-connected.py |
+setup/model/linear.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 125 \
+  --learning-momentum 0.0 \
+  --learning-rate 0.1 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 2 |
+simulate/run.py \
+  --nb-epochs 100
-- 
GitLab