-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
63 lines (45 loc) · 1.1 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
.ONESHELL:
DATA_DIR = data/full_data
CONFIG_DIR = config
COUNTS_FILE = data/counts.json
TRAINER_CONFIG = config/lanl_config_trainer.json
FLAGS = -tc $(TRAINER_CONFIG) -df $(DATA_DIR)
TRAIN_MODEL = python log_analyzer/train_model.py
ifdef BIDIRECTIONAL
FLAGS += --bidir
endif
ifdef CUDA
FLAGS += --use-cuda
endif
ifdef WANDB
FLAGS += --wandb-sync
endif
ifdef LOAD
FLAGS += --load-model $(LOAD)
endif
ifdef EVAL
FLAGS += --eval-only
endif
ifdef PYFLAGS
FLAGS += $(PYFLAGS)
endif
counts: data/full_data/*.csv
generate-counts $^ -o data/counts.json
prepare_data: data/auth.txt data/redteam.txt
process-auth $^
$(MAKE) counts
tox:
tox
lint:
tox -e py3-lint
install:
pip install -e .
profile-%: config/lanl_config_%.json
python -m cProfile $(TRAIN_MODEL) lstm -cf $(COUNTS_FILE) -mc $^
.PHONY: %_word
%_word-fields: TOKENIZATION=word-fields
%_word-global: TOKENIZATION=word-global
%_word-merged: TOKENIZATION=word-merged
%_char: TOKENIZATION=char
%_word-fields %_word-global %_word-merged %_char: config/lanl_config_%.json
$(TRAIN_MODEL) $* $(TOKENIZATION) -cf $(COUNTS_FILE) -mc $^ $(FLAGS) --wandb-group $@