-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all.sh
102 lines (69 loc) · 6.3 KB
/
run_all.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
REGION_NAME="UTAustin"
OUTPUT_DIR=$HOME/tmp/rvs_run/$REGION_NAME
MAP_DIR=$OUTPUT_DIR/map
OUTPUT_DIR_MODEL=$OUTPUT_DIR/rvs_run/manhattan
OUTPUT_DIR_MODEL_RVS=$OUTPUT_DIR_MODEL/rvs
OUTPUT_DIR_MODEL_RVS_FIXED_4=$OUTPUT_DIR_MODEL/rvs/fixed_4
OUTPUT_DIR_MODEL_RVS_FIXED_5=$OUTPUT_DIR_MODEL/rvs/fixed_5
OUTPUT_DIR_MODEL_HUMAN=$OUTPUT_DIR_MODEL/human
OUTPUT_DIR_MODEL_AUGMENTATION=$OUTPUT_DIR_MODEL/augmentation
echo "****************************************"
echo "* Geo *"
echo "****************************************"
rm -rf $OUTPUT_DIR
mkdir -p $OUTPUT_DIR
mkdir -p $MAP_DIR
bazel-bin/rvs/geo/map_processing/map_processor --region $REGION_NAME --min_s2_level 18 --directory $MAP_DIR
bazel-bin/rvs/geo/sample_poi --region $REGION_NAME --min_s2_level 18 --directory $MAP_DIR --path $MAP_DIR/utaustin_geo_paths.gpkg --n_samples 8
echo "****************************************"
echo "* graph embeddings *"
echo "****************************************"
GRAPH_EMBEDDING_PATH=$MAP_DIR/graph_embedding.pth
bazel-bin/rvs/data/metagraph/create_graph_embedding --region $REGION_NAME --dimensions 224 --s2_level 15 --s2_node_levels 15 --base_osm_map_filepath $MAP_DIR --save_embedding_path $GRAPH_EMBEDDING_PATH --num_walks 2 --walk_length 2
echo "****************************************"
echo "* Wikidata *"
echo "****************************************"
bazel-bin/rvs/data/wikidata/extract_geofenced_wikidata_items --region $REGION_NAME
echo "****************************************"
echo "* Wikipedia *"
echo "****************************************"
bazel-bin/rvs/data/wikipedia/extract_wikipedia_items --titles=New_York_Stock_Exchange,Empire_State_Building
echo "****************************************"
echo "* Wikigeo *"
echo "****************************************"
bazel-bin/rvs/data/create_wikigeo_dataset --region $REGION_NAME --output_dir $OUTPUT_DIR/wikigeo
bazel-bin/rvs/data/create_wikigeo_dataset --region $REGION_NAME --output_dir $OUTPUT_DIR/wikigeo --osm_path $MAP_DIR/utaustin_poi.pkl
echo "**********************************************"
echo "* Generate CFG-based data for augmentation *"
echo "**********************************************"
bazel-bin/rvs/generation/generate_synth --geo_data_path $MAP_DIR/utaustin_geo_paths.gpkg --save_instruction_dir $OUTPUT_DIR
echo "****************************************"
echo "* models *"
echo "****************************************"
mkdir -p $OUTPUT_DIR_MODEL
mkdir -p $OUTPUT_DIR_MODEL_RVS
mkdir -p $OUTPUT_DIR_MODEL_RVS_FIXED_4
mkdir -p $OUTPUT_DIR_MODEL_RVS_FIXED_5
mkdir -p $OUTPUT_DIR_MODEL_HUMAN
mkdir -p $OUTPUT_DIR_MODEL_AUGMENTATION
echo "* Dual-Encoder-Bert - HUMAN DATA *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir ~/RVS/dataset --processed_data_dir $OUTPUT_DIR_MODEL_HUMAN --train_region Manhattan --dev_region Manhattan --test_region Manhattan --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_HUMAN --num_epochs 1 --task RVS --model Dual-Encoder-Bert
echo "* Classification-Bert - HUMAN DATA *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir ~/RVS/dataset --processed_data_dir $OUTPUT_DIR_MODEL_HUMAN --train_region Manhattan --dev_region Manhattan --test_region Manhattan --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_HUMAN --num_epochs 1 --task RVS --model Classification-Bert
echo "* S2-Generation-T5 - HUMAN DATA *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir ~/RVS/dataset --processed_data_dir $OUTPUT_DIR_MODEL_HUMAN --train_region Manhattan --dev_region Manhattan --test_region Manhattan --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_HUMAN --num_epochs 1 --task RVS --model S2-Generation-T5 --train_batch_size 20 --test_batch_size 40
echo "* S2-Generation-T5-start-text-input - HUMAN DATA *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir ~/RVS/dataset --processed_data_dir $OUTPUT_DIR_MODEL_HUMAN --train_region Manhattan --dev_region Manhattan --test_region Manhattan --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_HUMAN --num_epochs 1 --task RVS --model S2-Generation-T5-start-text-input --train_batch_size 20 --test_batch_size 40
echo "* S2-Generation-T5-Landmarks - HUMAN DATA *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir ~/RVS/dataset --processed_data_dir $OUTPUT_DIR_MODEL_HUMAN --train_region Manhattan --dev_region Manhattan --test_region Manhattan --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_HUMAN --num_epochs 1 --task RVS --model S2-Generation-T5-Landmarks --train_batch_size 20 --test_batch_size 40
echo "* Baseline *"
bazel-bin/rvs/model/baselines --raw_data_dir ~/RVS/dataset --metrics_dir $OUTPUT_DIR_MODEL_HUMAN --task RVS --region Philadelphia
echo "* Pre-train on CFG-Augmentation Data *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir $OUTPUT_DIR --processed_data_dir $OUTPUT_DIR_MODEL_AUGMENTATION --train_region $REGION_NAME --dev_region $REGION_NAME --test_region $REGION_NAME --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_AUGMENTATION --num_epochs 1 --task Synthetic --model S2-Generation-T5-text-start-embedding-to-landmarks --train_batch_size 20 --test_batch_size 40 --far_distance_threshold 2
echo "* Fine-tune on RVS Data *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir ~/RVS_AUG/dataset --processed_data_dir $OUTPUT_DIR_MODEL_HUMAN --train_region Manhattan --dev_region Manhattan --test_region Manhattan_dev --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_HUMAN --num_epochs 1 --task RVS --model S2-Generation-T5-text-start-embedding-to-landmarks --train_batch_size 20 --test_batch_size 40 --size_of_train_split 10
echo "* Pre-train on WikiGeo-Augmentation Data *"
bazel-bin/rvs/model/text/model_trainer --raw_data_dir $OUTPUT_DIR/wikigeo --processed_data_dir $OUTPUT_DIR_MODEL_AUGMENTATION --train_region $REGION_NAME --dev_region $REGION_NAME --test_region $REGION_NAME --s2_level 15 --output_dir $OUTPUT_DIR_MODEL_AUGMENTATION --num_epochs 1 --task WikiGeo --model S2-Generation-T5-text-start-embedding-to-landmarks --train_batch_size 20 --test_batch_size 40
echo "Delete DATA"
rm -rf $OUTPUT_DIR