generated from ashleve/lightning-hydra-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (44 loc) · 1.37 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
.PHONY: help
help: ## Show help
@grep -E '^[.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: clean
clean: ## Clean autogenerated files
rm -rf dist
find . -type f -name "*.DS_Store" -ls -delete
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
find . | grep -E ".pytest_cache" | xargs rm -rf
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
rm -f .coverage
.PHONY: clean-logs
clean-logs: ## Clean logs
rm -r logs/**
.PHONY: style
style: ## Run pre-commit hooks
pre-commit run -a
.PHONY: sync
sync: ## Merge changes from main branch to your current branch
git fetch --all
git merge main
.PHONY: test
test: ## Run not slow tests
pytest -k "not slow"
.PHONY: test-full
test-full: ## Run all tests
pytest
.PHONY: debug
debug: ## Enter debugging mode with pdb, an example.
#
# tips:
# - use "breakpoint()" to set breakpoint
# - use "h" to print all commands
# - use "n" to execute the next line
# - use "c" to run until the breakpoint is hit
# - use "l" to print src code around current line, "ll" for full function code
# - docs: https://docs.python.org/3/library/pdb.html
#
python -m pdb -m mart experiment=CIFAR10_CNN debug=default
.PHONY: cifar_train
cifar_train: ## Adversarial training for a CIFAR-10 model.
python -m mart experiment=CIFAR10_CNN_Adv \
fit=true \
trainer=gpu