-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·52 lines (43 loc) · 1.34 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
if [ -d "logs" ]; then
rm -rf logs
fi
if [ -d "plots" ]; then
rm -rf plots
fi
if [ -d "videos" ]; then
rm -rf videos
fi
if [ ! -d "plots" ]; then
mkdir plots
fi
if [ ! -d "videos" ]; then
mkdir videos
fi
if [ ! -d "logs" ]; then
mkdir logs
fi
# alpha values
alpha_values=(0.1 0.2 0.3)
# gamma values
gamma_values=(0.995 0.9 0.85)
# epsilon values
epsilon_values=(0.1 0.2 0.3)
# Run the experiments
for alpha in "${alpha_values[@]}"
do
# for loop for gamma values
for gamma in "${gamma_values[@]}"
do
# for loop for epsilon values
for epsilon in "${epsilon_values[@]}"
do
touch logs/sarsa_${alpha}_${gamma}_${epsilon}.txt
# run the main.py file - sarsa algorithm
(python3 main.py --algorithm sarsa --alpha $alpha --gamma $gamma --epsilon $epsilon --num_episodes 10000 --num_steps 500 --num_bins 20 --seed 2)>>logs/sarsa_${alpha}_${gamma}_${epsilon}.txt
echo "sarsa_${alpha}_${gamma}_${epsilon} done"
# run the main.py file - q_learning algorithm
(python3 main.py --algorithm q_learning --alpha $alpha --gamma $gamma --epsilon $epsilon --num_episodes 10000 --num_steps 500 --num_bins 20 --seed 2)>>logs/q_learning_${alpha}_${gamma}_${epsilon}.txt
echo "q_learning_${alpha}_${gamma}_${epsilon} done"
done
done
done