-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
91 lines (70 loc) · 2.94 KB
/
Makefile
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
#-------------------------------------------------------------------------------
# This file serves as an example to show how one might use the example code.
# Of primary interest are:
#
# baseline-attacks : Creates example/baseline attacks
# baseline-defenses : Create example/baseline defense submissions
# demo : Creates a local competition "simulation" by running
# some baseline algorithms against each other.
#
# Feb, 2018
#-------------------------------------------------------------------------------
# Change this to point to your local sample data (with truth)
#GROUND_TRUTH_DIR=~/Data/FMoW_a
GROUND_TRUTH_DIR=/home/fendlnm1/AML_Practice_Round_2_RGB
# these are temporary directories for demo
SIM_DIR=/
TEAM_DIR=/nfs/
OUTPUT_DIR=./Evaluation_Output
#-------------------------------------------------------------------------------
default :
echo "Please pick an explicit target!"
baseline-attacks :
cd ./attacks/sample_attack && ./run_attack.sh $(GROUND_TRUTH_DIR) fgm
cd ./attacks/sample_attack && ./run_attack.sh $(GROUND_TRUTH_DIR) random
cd ./attacks/sample_attack && ./run_attack.sh $(GROUND_TRUTH_DIR) ifgm
baseline-defenses :
cd ./defenses/sample_defense && ./defense_zip.sh
# This just runs all the necessary pieces in order
demo : baseline-attacks baseline-defenses dummy-framework eval
dummy-framework :
echo "creating ground truth"
mkdir -p $(SIM_DIR)/ground_truth
cp $(GROUND_TRUTH_DIR)/* $(SIM_DIR)/ground_truth
@echo "--------------------------"
@echo "creating noop-defense"
@echo "--------------------------"
mkdir -p $(TEAM_DIR)/noop/attack
mkdir -p $(TEAM_DIR)/noop/defense
cp ./defenses/sample_defense/defense_noop_submission.zip $(TEAM_DIR)/noop/defense
@echo "--------------------------"
@echo "creating averaging defense"
@echo "--------------------------"
mkdir -p $(TEAM_DIR)/averaging/attack
mkdir -p $(TEAM_DIR)/averaging/defense
cp ./defenses/sample_defense/defense_avg_submission.zip $(TEAM_DIR)/averaging/defense
@echo "--------------------------"
@echo "creating random attack"
@echo "--------------------------"
mkdir -p $(TEAM_DIR)/random/attack
mkdir -p $(TEAM_DIR)/random/defense
cp ./attacks/sample_attack/sample_attack_random.zip $(TEAM_DIR)/random/attack
@echo "--------------------------"
@echo "creating FGM attack"
@echo "--------------------------"
mkdir -p $(TEAM_DIR)/fgm/attack
mkdir -p $(TEAM_DIR)/fgm/defense
cp ./attacks/sample_attack/sample_attack_fgm.zip $(TEAM_DIR)/fgm/attack
@echo "--------------------------"
@echo "creating I-FGM attack"
@echo "--------------------------"
mkdir -p $(TEAM_DIR)/ifgm/attack
mkdir -p $(TEAM_DIR)/ifgm/defense
cp ./attacks/sample_attack/sample_attack_ifgm.zip $(TEAM_DIR)/ifgm/attack
eval :
python evaluate_submissions.py $(TEAM_DIR) $(GROUND_TRUTH_DIR) $(OUTPUT_DIR) 1 5 10
# Blows away the example framework
clean :
\rm -rf $(SIM_DIR)
query :
python evaluate_submissions.py $(TEAM_DIR) query $(OUTPUT_DIR)