From dfe4cb11affb7085fa6e1cc43ffa56f4e718830b Mon Sep 17 00:00:00 2001
From: Erick Lavoie <erick.lavoie@epfl.ch>
Date: Sat, 2 Oct 2021 18:51:55 +0200
Subject: [PATCH] Added CIFAR10 experiments

---
 ...baseline-cifar10-2-shards-eq-classes-fc.sh | 39 +++++++++++++++
 ...aseline-cifar10-iid-eq-classes-50k-fc-1.sh | 39 +++++++++++++++
 .../baseline-cifar10-iid-eq-classes-fc-1.sh   | 39 +++++++++++++++
 .../baseline-cifar10-max-local-skew-fc.sh     | 39 +++++++++++++++
 ...wap-cifar10-2-shards-eq-classes-fc-1000.sh | 43 +++++++++++++++++
 ...edy-swap-cifar10-2-shards-eq-classes-fc.sh | 47 +++++++++++++++++++
 ...dc-ideal-cifar10-max-local-skew-fc-1000.sh | 41 ++++++++++++++++
 .../dc-ideal-cifar10-max-local-skew-fc.sh     | 45 ++++++++++++++++++
 8 files changed, 332 insertions(+)
 create mode 100755 results-v2/baseline-cifar10-2-shards-eq-classes-fc.sh
 create mode 100755 results-v2/baseline-cifar10-iid-eq-classes-50k-fc-1.sh
 create mode 100755 results-v2/baseline-cifar10-iid-eq-classes-fc-1.sh
 create mode 100755 results-v2/baseline-cifar10-max-local-skew-fc.sh
 create mode 100644 results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc-1000.sh
 create mode 100755 results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc.sh
 create mode 100755 results-v2/dc-ideal-cifar10-max-local-skew-fc-1000.sh
 create mode 100755 results-v2/dc-ideal-cifar10-max-local-skew-fc.sh

diff --git a/results-v2/baseline-cifar10-2-shards-eq-classes-fc.sh b/results-v2/baseline-cifar10-2-shards-eq-classes-fc.sh
new file mode 100755
index 0000000..2eefb6b
--- /dev/null
+++ b/results-v2/baseline-cifar10-2-shards-eq-classes-fc.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 \
+  --validation-examples-per-class 0 0 0 0 0 0 0 0 0 0 |
+setup/nodes/google-fl.py \
+  --name 2-shards-eq-classes \
+  --nb-nodes 100 \
+  --local-shards 2 \
+  --shard-size 250 |
+setup/topology/fully-connected.py |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 20 \
+  --learning-momentum 0.9 \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 8 |
+simulate/run.py \
+  --nb-epochs 100
diff --git a/results-v2/baseline-cifar10-iid-eq-classes-50k-fc-1.sh b/results-v2/baseline-cifar10-iid-eq-classes-50k-fc-1.sh
new file mode 100755
index 0000000..9d62ff2
--- /dev/null
+++ b/results-v2/baseline-cifar10-iid-eq-classes-50k-fc-1.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 \
+  --validation-examples-per-class 0 0 0 0 0 0 0 0 0 0 |
+setup/nodes.py \
+  --name iid-eq-classes \
+  --nb-nodes 1 \
+  --nodes-per-class 1 1 1 1 1 1 1 1 1 1 \
+  --local-classes 10 |
+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\
+  --nb-processes 1 |
+simulate/run.py \
+  --nb-epochs 100
diff --git a/results-v2/baseline-cifar10-iid-eq-classes-fc-1.sh b/results-v2/baseline-cifar10-iid-eq-classes-fc-1.sh
new file mode 100755
index 0000000..91ea1a2
--- /dev/null
+++ b/results-v2/baseline-cifar10-iid-eq-classes-fc-1.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 4500 4500 4500 4500 4500 4500 4500 4500 4500 4500 \
+  --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+setup/nodes.py \
+  --name iid-eq-classes \
+  --nb-nodes 1 \
+  --nodes-per-class 1 1 1 1 1 1 1 1 1 1 \
+  --local-classes 10 |
+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\
+  --nb-processes 1 |
+simulate/run.py \
+  --nb-epochs 100
diff --git a/results-v2/baseline-cifar10-max-local-skew-fc.sh b/results-v2/baseline-cifar10-max-local-skew-fc.sh
new file mode 100755
index 0000000..d26bab0
--- /dev/null
+++ b/results-v2/baseline-cifar10-max-local-skew-fc.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 4500 4500 4500 4500 4500 4500 4500 4500 4500 4500 \
+  --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+setup/nodes.py \
+  --name max-local-skew \
+  --nb-nodes 100 \
+  --nodes-per-class 10 10 10 10 10 10 10 10 10 10 \
+  --local-classes 1 |
+setup/topology/fully-connected.py |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 20 \
+  --learning-momentum 0.9 \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 8 |
+simulate/run.py \
+  --nb-epochs 100
diff --git a/results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc-1000.sh b/results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc-1000.sh
new file mode 100644
index 0000000..026fef3
--- /dev/null
+++ b/results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc-1000.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 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 \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 \
+  --validation-examples-per-class 0 0 0 0 0 0 0 0 0 0 |
+setup/nodes/google-fl.py \
+  --name 2-shards-eq-classes \
+  --nb-nodes 1000 \
+  --local-shards 2 \
+  --shard-size 25 |
+setup/topology/d_cliques/greedy_swap.py \
+  --interclique fully-connected \
+  --max-clique-size 10 \
+  --max-steps 1000 |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 20 \
+  --learning-momentum 0.9 \
+  --clique-gradient \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 8 |
+simulate/run.py \
+  --nb-epochs 100;
diff --git a/results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc.sh b/results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc.sh
new file mode 100755
index 0000000..bb8e37f
--- /dev/null
+++ b/results-v2/dc-greedy-swap-cifar10-2-shards-eq-classes-fc.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 C_GRAD in '--clique-gradient' ''; do
+for MOMENTUM in '--learning-momentum 0.0' '--learning-momentum 0.9'; do
+setup/meta.py \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 \
+  --validation-examples-per-class 0 0 0 0 0 0 0 0 0 0 |
+setup/nodes/google-fl.py \
+  --name 2-shards-eq-classes \
+  --nb-nodes 100 \
+  --local-shards 2 \
+  --shard-size 250 |
+setup/topology/d_cliques/greedy_swap.py \
+  --interclique fully-connected \
+  --max-clique-size 10 \
+  --max-steps 1000 |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 20 \
+  $MOMENTUM \
+  $C_GRAD \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 8 |
+simulate/run.py \
+  --nb-epochs 100;
+done;
+done
diff --git a/results-v2/dc-ideal-cifar10-max-local-skew-fc-1000.sh b/results-v2/dc-ideal-cifar10-max-local-skew-fc-1000.sh
new file mode 100755
index 0000000..405fa1c
--- /dev/null
+++ b/results-v2/dc-ideal-cifar10-max-local-skew-fc-1000.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 4500 4500 4500 4500 4500 4500 4500 4500 4500 4500 \
+  --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+setup/nodes.py \
+  --name max-local-skew \
+  --nb-nodes 1000 \
+  --nodes-per-class 100 100 100 100 100 100 100 100 100 100 \
+  --local-classes 1 |
+setup/topology/d_cliques/ideal.py \
+  --interclique fully-connected |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 20 \
+  --learning-momentum 0.9 \
+  --clique-gradient \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 8 |
+simulate/run.py \
+  --nb-epochs 100;
diff --git a/results-v2/dc-ideal-cifar10-max-local-skew-fc.sh b/results-v2/dc-ideal-cifar10-max-local-skew-fc.sh
new file mode 100755
index 0000000..776ce6f
--- /dev/null
+++ b/results-v2/dc-ideal-cifar10-max-local-skew-fc.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+# Path to current script
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+TOOLS=$SCRIPT_DIR/$(cat 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 C_GRAD in '--clique-gradient' ''; do
+for MOMENTUM in '--learning-momentum 0.0' '--learning-momentum 0.9'; do
+setup/meta.py \
+  --script $SCRIPT_DIR/`basename "$0"` \
+  --results-directory $SCRIPT_DIR/tmp \
+  --seed 1 |
+setup/dataset.py \
+  --name cifar10 \
+  --train-examples-per-class 4500 4500 4500 4500 4500 4500 4500 4500 4500 4500 \
+  --validation-examples-per-class 500 500 500 500 500 500 500 500 500 500 |
+setup/nodes.py \
+  --name max-local-skew \
+  --nb-nodes 100 \
+  --nodes-per-class 10 10 10 10 10 10 10 10 10 10 \
+  --local-classes 1 |
+setup/topology/d_cliques/ideal.py \
+  --interclique fully-connected |
+setup/model/gn_lenet.py |
+simulate/algorithm/d_sgd.py \
+  --batch-size 20 \
+  $MOMENTUM \
+  $C_GRAD \
+  --learning-rate 0.002 |
+simulate/logger.py \
+  --accuracy-logging-interval 10\
+  --nb-processes 8 |
+simulate/run.py \
+  --nb-epochs 100;
+done;
+done
-- 
GitLab