-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (62 loc) · 1.4 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
# Environment variables
PYTHON = python
PIP = pip
REMOVE = rm -rf
CREATE = mkdir -p
PRINT = @echo
# Paths
LOG_PATH = ./logs
# targets
## setup : Setup the virtual environment.
.PHONY: setup
## install : Install dependencies.
.PHONY: install
## update : Update dependencies.
.PHONY: update
## experiments : Run experiments.
.PHONY: experiments
## clean : Clean up.
.PHONY: clean
## visualize : Visualize results on tensorboard.
.PHONY: visualize
## reset : Reset the environment.
.PHONY: reset
# recipes
setup: create_env create_temp
install: install_requirements
update: update_requirements
experiments: create_temp run_experiments
reset: clean create_temp
# rules
create_env:
$(PRINT) "Creating Virtual Environment..."
$(PYTHON) -m venv ./.venv
$(PRINT)
install_requirements:
$(PRINT) "Installing Dependencies..."
$(PIP) install -r ./requirements.txt
$(PRINT) ""
update_requirements:
$(PRINT) "Updating Dependencies..."
$(PIP) freeze > ./requirements.txt
$(PRINT) ""
run_experiments:
$(PRINT) "Running experiments..."
$(PYTHON) ./main.py
$(PRINT) ""
clean:
$(PRINT) "Cleaning weights"
$(REMOVE) ./weights
$(PRINT) "Cleaning generated samples"
$(REMOVE) ./samples
$(PRINT) "Cleaning logs"
$(REMOVE) ./logs
$(PRINT) ""
create_temp:
$(PRINT) "Creating directory structure..."
$(CREATE) ./weights
$(CREATE) ./samples
$(CREATE) ./logs
$(PRINT) ""
visualize:
tensorboard --logdir $(LOG_PATH)