citybert/Makefile

43 lines
1.2 KiB
Makefile
Raw Normal View History

2023-05-04 22:41:31 +00:00
all: install data train eval
city_distances_full.csv: check generate_data.py
2023-05-04 19:09:36 +00:00
@echo "Generating distance data..."
2023-05-05 03:41:51 +00:00
@bash -c 'time python generate_data.py -w 8 -c US'
2023-05-04 10:03:15 +00:00
2023-05-04 22:41:31 +00:00
data: city_distances_full.csv
2023-05-04 19:05:33 +00:00
train: check train.py
2023-05-04 19:09:36 +00:00
@echo "Training embeddings..."
@bash -c 'time python train.py'
2023-05-04 19:05:33 +00:00
eval: check eval.py
2023-05-04 19:09:36 +00:00
@echo "Evaluating trained model..."
@bash -c 'time python eval.py'
2023-05-04 19:05:33 +00:00
2023-05-04 10:03:15 +00:00
lint:
2023-05-04 19:09:36 +00:00
@echo "Auto-linting files and performing final style checks..."
@isort --profile=black .
@black .
2023-05-05 05:43:15 +00:00
@flake8 --max-line-length=88 --ignore E203 .
2023-05-04 10:03:15 +00:00
2023-05-04 19:05:33 +00:00
check: lint
@echo "Checking for unstaged or untracked changes..."
@git diff-index --quiet HEAD -- || { echo "Unstaged or untracked changes detected!"; exit 1; }
2023-05-04 10:03:15 +00:00
clean:
2023-05-04 19:09:36 +00:00
@echo "Removing outputs/ and checkpoints/ directories"
@rm -rf output/
2023-05-04 22:41:31 +00:00
@rm -rf checkpoints/
2023-05-05 02:01:51 +00:00
compress: plots/progress_136013_sm.png
2023-05-04 22:41:31 +00:00
2023-05-05 02:01:51 +00:00
plots/progress_136013_sm.png: plots/progress_136013.png
@convert -resize 33% plots/progress_136013.png plots/progress_136013_sm.png
2023-05-04 22:41:31 +00:00
2023-05-05 05:50:51 +00:00
install: .requirements_installed
.requirements_installed: requirements.txt
2023-05-04 22:41:31 +00:00
pip install -r requirements.txt
2023-05-05 05:50:51 +00:00
@echo "installed requirements" > .requirements_installed
2023-05-04 22:41:31 +00:00
.PHONY: data train eval lint check clean all