diff --git a/how_to.md b/how_to.md index 8fe4ea5..6cf4baf 100644 --- a/how_to.md +++ b/how_to.md @@ -9,8 +9,15 @@ Install the requirements: pip install -r requirements.txt ``` +## Hardware requirements + +In order to run the code a GPU is strongly recommended. +The code is tested on a machine with 1 NVIDIA A100 GPUs with 40GB. + ## Examples +Script examples for different datasets are provided in the `scripts` folder. + Get help: ```bash python main.py --help @@ -109,7 +116,7 @@ optional arguments: The index of the trigger label --momentum MOMENTUM Momentum --alpha ALPHA Alpha - --beta BETA Beta + --beta BETA Beta. Gamma in the paper --data_dir DATA_DIR Data directory --save_path SAVE_PATH Path to save the experiments diff --git a/scripts/dynamic.sh b/scripts/dynamic.sh new file mode 100644 index 0000000..754d8d2 --- /dev/null +++ b/scripts/dynamic.sh @@ -0,0 +1,11 @@ +# N-MNIST +python dynamic.py --dataset mnist --cupy --epochs 10 --train_epochs 1 --alpha 0.5 --beta 0.01 + +# CIFAR-10 +python dynamic.py --dataset cifar10 --cupy --epochs 28 --train_epochs 1 --alpha 0.5 --beta 0.01 + +# Gesture +python dynamic.py --dataset gesture --cupy --epochs 64 --train_epochs 1 --alpha 0.5 --beta 0.01 + +# Caltech-101 +python dynamic.py --dataset caltech --cupy --epochs 30 --train_epochs 1 --alpha 0.5 --beta 0.01 \ No newline at end of file diff --git a/scripts/moving.sh b/scripts/moving.sh new file mode 100644 index 0000000..37ad1fa --- /dev/null +++ b/scripts/moving.sh @@ -0,0 +1,11 @@ +# N-MNIST +python main.py --dataset mnist --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type moving --cupy --epochs 10 + +# CIFAR-10 +python main.py --dataset cifar10 --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type moving --cupy --epochs 28 + +# Gesture +python main.py --dataset gesture --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type moving --cupy --epochs 64 + +# Caltech-101 +python main.py --dataset caltech --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type moving --cupy --epochs 30 \ No newline at end of file diff --git a/scripts/smart.sh b/scripts/smart.sh new file mode 100644 index 0000000..c8aecb6 --- /dev/null +++ b/scripts/smart.sh @@ -0,0 +1,11 @@ +# N-MNIST +python main.py --dataset mnist --n_masks 2 --trigger_size 0.1 --epsilon 0.1 --type smart --cupy --epochs 10 + +# CIFAR-10 +python main.py --dataset cifar10 --n_masks 2 --trigger_size 0.1 --epsilon 0.1 --type smart --cupy --epochs 28 + +# Gesture +python main.py --dataset gesture --n_masks 2 --trigger_size 0.1 --epsilon 0.1 --type smart --cupy --epochs 64 + +# Caltech-101 +python main.py --dataset caltech --n_masks 2 --trigger_size 0.1 --epsilon 0.1 --type smart --cupy --epochs 30 \ No newline at end of file diff --git a/scripts/static.sh b/scripts/static.sh new file mode 100644 index 0000000..fe742ed --- /dev/null +++ b/scripts/static.sh @@ -0,0 +1,11 @@ +# N-MNIST +python main.py --dataset mnist --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type static --cupy --epochs 10 + +# CIFAR-10 +python main.py --dataset cifar10 --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type static --cupy --epochs 28 + +# Gesture +python main.py --dataset gesture --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type static --cupy --epochs 64 + +# Caltech-101 +python main.py --dataset caltech --polarity 1 --pos top-left --trigger_size 0.1 --epsilon 0.1 --type static --cupy --epochs 30 \ No newline at end of file