-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiple_inference.sh
More file actions
42 lines (32 loc) · 986 Bytes
/
multiple_inference.sh
File metadata and controls
42 lines (32 loc) · 986 Bytes
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
#!/bin/bash
# chmod +x multiple_inference.sh
# ./multiple_inference.sh
# Install necessary Python packages
pip install numpy matplotlib torch psutil
# Set parameters
training_data=100000
epochs=100
# Outer loop for values of m in the range 1 to 3
for m in {1..3};
do
# Inner loop for values of k in the range 5 to 20
for k in {5..20};
do
# Record the start time
start_time=$(date +%s)
python inference_set.py "$m" "$k" "$training_data" "$epochs"
# Record the end time
end_time=$(date +%s)
# Calculate the duration
duration=$((end_time - start_time))
# Convert the duration to hours and minutes
hours=$((duration / 3600))
minutes=$(((duration % 3600) / 60))
seconds=$(((duration % 3600) % 60))
echo ""
echo ""
echo "Total time taken for m = $m, k = $k:"
echo " $hours : $minutes : $seconds"
done
python plot_models_inference.py "$m"
done