-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
77 lines (69 loc) · 2.54 KB
/
run.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
#!/bin/bash
# Setup for running training models for four different cities
# Ensure CUDA devices are correctly assigned (assuming a multi-GPU setup)
export CUDA_VISIBLE_DEVICES=0
# Define common parameters
EPOCHS=30
BASE_LR=0.0003
MODEL_NAME="MobilityBERTMoE"
MODEL_PATH="path_to_pretrained_model.pth"
LOCATION_EMBEDDING_LR=0.0001 # This can be adjusted or removed if not needed
# Training for City A
CITY="A"
NUM_LOCATION_IDS=40000
HIDDEN_SIZE=256
HIDDEN_LAYERS=24
ATTENTION_HEADS=16
DAY_EMBED_SIZE=64
TIME_EMBED_SIZE=64
DAY_OF_WEEK_EMBED_SIZE=64
WEEKDAY_EMBED_SIZE=32
LOCATION_EMBED_SIZE=256
DROPOUT=0.2
MAX_SEQ_LENGTH=3648 # Example length, adjust as needed
python main.py --model_name $MODEL_NAME \
--num_location_ids $NUM_LOCATION_IDS \
--hidden_size $HIDDEN_SIZE \
--hidden_layers $HIDDEN_LAYERS \
--attention_heads $ATTENTION_HEADS \
--day_embedding_size $DAY_EMBED_SIZE \
--time_embedding_size $TIME_EMBED_SIZE \
--day_of_week_embedding_size $DAY_OF_WEEK_EMBED_SIZE \
--weekday_embedding_size $WEEKDAY_EMBED_SIZE \
--location_embedding_size $LOCATION_EMBED_SIZE \
--dropout $DROPOUT \
--max_seq_length $MAX_SEQ_LENGTH \
--lr $BASE_LR \
--location_embedding_lr $LOCATION_EMBEDDING_LR \
--num_epochs $EPOCHS \
--device "cuda:0"
# Fine-tune for City B, C, D
CITY="B"
NUM_LOCATION_IDS=40000
HIDDEN_SIZE=256
HIDDEN_LAYERS=24
ATTENTION_HEADS=16
DAY_EMBED_SIZE=64
TIME_EMBED_SIZE=64
DAY_OF_WEEK_EMBED_SIZE=64
WEEKDAY_EMBED_SIZE=32
LOCATION_EMBED_SIZE=256
DROPOUT=0.2
MAX_SEQ_LENGTH=3648 # Example length, adjust as needed
python main.py --model_name $MODEL_NAME \
--num_location_ids $NUM_LOCATION_IDS \
--hidden_size $HIDDEN_SIZE \
--hidden_layers $HIDDEN_LAYERS \
--attention_heads $ATTENTION_HEADS \
--day_embedding_size $DAY_EMBED_SIZE \
--time_embedding_size $TIME_EMBED_SIZE \
--day_of_week_embedding_size $DAY_OF_WEEK_EMBED_SIZE \
--weekday_embedding_size $WEEKDAY_EMBED_SIZE \
--location_embedding_size $LOCATION_EMBED_SIZE \
--dropout $DROPOUT \
--max_seq_length $MAX_SEQ_LENGTH \
--lr $BASE_LR \
--location_embedding_lr $LOCATION_EMBEDDING_LR \
--num_epochs $EPOCHS \
--device "cuda:0" \
--model_path $MODEL_PATH