-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
68 lines (49 loc) · 2.08 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
BASE_DIR := $(shell pwd)
POETRY_RUN := poetry run
TRAIN_ARTIFACTS_DIR := ${BASE_DIR}/log/train_$(shell date +'%Y%m%d')
TRAIN_CONFIG_PATH := ${BASE_DIR}/config/train.yaml
EVALUATION_CONFIG_PATH := ${BASE_DIR}/config/evaluation.yaml
PREDICT_CONFIG_PATH := ${BASE_DIR}/config/predict.yaml
INTREPRET_CONFIG_PATH := ${BASE_DIR}/config/interpret.yaml
# override configs (defaults No overrides)
OVERRIDES :=
TENSORBORD_LOG_DIR := ...
install:
poetry install
notebook:
${POETRY_RUN} jupyter-notebook
train:
@echo training
mkdir -p ${TRAIN_ARTIFACTS_DIR}
${POETRY_RUN} expats train ${TRAIN_CONFIG_PATH} ${TRAIN_ARTIFACTS_DIR} --overrides ${OVERRIDES}
train-debug:
IS_DEBUG=true make train TRAIN_CONFIG_PATH=config/train_debug.yaml TRAIN_ARTIFACTS_DIR=log/debug
evaluate:
@echo evaluation on pre-trained model
${POETRY_RUN} expats evaluate ${EVALUATION_CONFIG_PATH} --overrides ${OVERRIDES}
evaluate-debug:
IS_DEBUG=true make evaluate EVALUATION_CONFIG_PATH=config/evaluate_debug.yaml
predict:
@echo evaluation on pre-trained model
${POETRY_RUN} expats predict ${PREDICT_CONFIG_PATH} ${PREDICT_OUTPUT_PATH} --overrides ${OVERRIDES}
predict-debug:
IS_DEBUG=true make predict PREDICT_CONFIG_PATH=config/predict_debug.yaml PREDICT_OUTPUT_PATH=log/debug_predict
interpret:
@echo interpreting pre-trained model
${POETRY_RUN} expats interpret ${INTREPRET_CONFIG_PATH} --overrides ${OVERRIDES}
interpret-debug:
IS_DEBUG=true make interpret INTREPRET_CONFIG_PATH=config/interpret_debug.yaml
train-then-evaluate:
$(eval ARTIFACT_PATH := ${BASE_DIR}/log/$(shell date +'%Y%m%d%H%M%S'))
make train TRAIN_CONFIG_PATH=${TRAIN_CONFIG_PATH} TRAIN_ARTIFACTS_DIR=${ARTIFACT_PATH} OVERRIDES='${TRAIN_OVERRIDES}'
make evaluate EVALUATION_CONFIG_PATH=${EVALUATION_CONFIG_PATH} OVERRIDES='artifact_path=${ARTIFACT_PATH} ${EVALUATION_OVERRIDES}'
rm -rf ${ARTIFACT_PATH}
tensorboard:
${POETRY_RUN} tensorboard --logdir ${TENSORBORD_LOG_DIR}
# CI
lint:
${POETRY_RUN} flake8 --show-source --statistics ./expats ./tests
test:
${POETRY_RUN} pytest -rf --cov=./expats ./tests
typecheck:
@echo currently not support to check types