citybert/Makefile

46 lines
1.3 KiB
Makefile
Raw Permalink Normal View History

2023-05-04 22:41:31 +00:00
all: install data train eval
2023-05-05 16:46:38 +00:00
city_distances.csv: generate_data.py
2023-05-04 19:09:36 +00:00
@echo "Generating distance data..."
2023-05-05 06:42:14 +00:00
@bash -c 'time python generate_data.py --country US --workers 8 --chunk-size 4200'
2023-05-05 16:46:38 +00:00
@echo "Calculating range of generated data..."
@cat city_distances.csv | tail -n +2 | sort -t',' -k3n | head -n1
@cat city_distances.csv | tail -n +2 | sort -t',' -k3nr | head -n1
2023-05-04 10:03:15 +00:00
2023-05-05 07:11:38 +00:00
data: city_distances.csv
2023-05-04 22:41:31 +00:00
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 16:46:38 +00:00
compress: plots/progress_12474_sm.png
2023-05-04 22:41:31 +00:00
2023-05-05 16:46:38 +00:00
plots/progress_12474_sm.png: plots/progress_12474.png
@convert -resize 33% plots/progress_12474.png progress_sample.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