This repository has been archived by the owner on Aug 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (53 loc) · 1.58 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
SHELL := /bin/bash
ifndef $LIMIT
LIMIT:=2 5 0
endif
ifndef $SAMPLE
SAMPLE:=50
endif
ifndef $TIMES
TIMES:=3
endif
ifndef $CLS
CLS:=xgb dnn
endif
ifndef $RESDIR
RESDIR:=output
endif
DATA_DIR := ./data
ATTACKS := hsj zoo
ROBUST = T_ROBUST F_ROBUST
T_ROBUST := --robust
F_ROBUST :=
ALWAYS := --resume
IOT_OPTIONS := --validator IOT23 --config config/iot.yaml
NB_OPTIONS := --validator NB15 --config config/unsw.yaml
DS_1 := -d ./data/CTU.csv $(IOT_OPTIONS)
DS_2 := -d ./data/nb15.csv $(NB_OPTIONS)
DATASETS := DS_1 DS_2
query:
@$(foreach i, $(LIMIT), $(foreach c, $(CLS), $(foreach r, $(ROBUST), \
$(foreach attack, $(ATTACKS), $(foreach ds, $(DATASETS), \
python3 -m aml experiment $(ALWAYS) --out output/query -a $(attack) $($(ds)) $($(r)) \
--iter $(i) -c $(c) ; )))))
sample:
@$(foreach c, $(CLS), $(foreach r, $(ROBUST), $(foreach attack, $(ATTACKS), \
python3 -m aml experiment $(ALWAYS) --out output/sample -a $(attack) $(DS_2) $($(r)) \
--iter 0 -s $(SAMPLE) -t $(TIMES) -c $(c) ; )))
valid:
@$(foreach file, $(wildcard $(DATA_DIR)/CTU*), \
python3 -m aml validate -d $(file) --validator IOT23 --capture;)
@$(foreach file, $(wildcard $(DATA_DIR)/nb15*), \
python3 -m aml validate -d $(file) --validator NB15 --capture;)
plot:
@python3 -m aml plot $(RESDIR)
plots:
@python3 -m aml plot output/query && python3 -m aml plot output/sample
lint:
flake8 ./aml --count --show-source --statistics
clean:
@rm -fr output/
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
@find . -name '__pycache__' -exec rm -fr {} +