-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_time_eval.sh
50 lines (42 loc) · 1.3 KB
/
run_time_eval.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
dataInputDir="1-data"
windowSize=10
model="lstm_ad"
dataInput=`ls $dataInputDir | head -n 1`
executionType="train"
while getopts 'd:s:m:t:' flag; do
case "${flag}" in
d) dataInput="${OPTARG}" ;;
s) windowSize="${OPTARG}" ;;
m) model="${OPTARG}" ;;
t) executionType="${OPTARG}" ;;
*) exit 1 ;;
esac
done
echo "dataInput: $dataInput"
echo "windowSize: $windowSize"
echo "model: $model"
echo "executionType: $executionType"
echo "-------------------"
algorithmConfig="{
\"executionType\": \"$executionType\",
\"input_size\": 2,
\"dataInput\": \"/data/$dataInput/train_no_anomaly.csv\",
\"dataOutput\": \"/results/anomaly_scores.ts\",
\"modelInput\": \"/results/model_${model}_${dataInput}_windowSize_$windowSize.pkl\",
\"modelOutput\": \"/results/model_${model}_${dataInput}_windowSize_$windowSize.pkl\",
\"customParameters\": {
\"window_size\": $windowSize,
\"epochs\": 10
}
}"
echo $algorithmConfig
echo "-------------------"
# Build new image
docker build -t mut:5000/akita/$model:latest time_eval_algorithms/$model/ --no-cache
docker run --rm \
-v $(pwd)/1-data:/data:ro \
-v $(pwd)/2-artifacts/models:/results:rw \
-e LOCAL_UID=1000 \
-e LOCAL_GID=1000 \
-p 8000:8000 \
mut:5000/akita/$model:latest execute-algorithm "$algorithmConfig"