-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_ppo_sigma _test.py
45 lines (36 loc) · 1.59 KB
/
run_ppo_sigma _test.py
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
import subprocess
import numpy as np
# subprocess.run(['git', 'pull'])
# subprocess.run(['git', 'add', '-A'])
# subprocess.run(['git', 'commit', '-m', 'Automated push: Test for sigma'])
# subprocess.run(['git', 'push'])
theta = str(1)
iterations = str(150)
number_of_equal_runs = 5
python_interpreter = #!INSERT PATH TO PYTHON INTERPRETER HERE
path = '/home/thops19/Documents/9semester/Project-in-Artificial-Intelligence-gym-challenge-/'
data_path = 'data'
subdir = 'TRPO_sigma_test_theta_' + theta
base_log_name = 'TRPO_sigma_'
sigma_test =[0.01, 0.02, 0.05, 0.1, 0.2]
# # Run the test for different sigma values
for j in range(0,number_of_equal_runs):
# round to 2 decimals
for i in sigma_test:
sigma = round(i, 3)
str_sigma = str(sigma) #add so 3 decimals are used
while 1:
if len(str_sigma) == 5:
break
str_sigma += '0'
log_name = base_log_name + str_sigma + '_number_' + str(j)
# Create the command
# print('sigma = ' + str_sigma + ' number ' + str(j))
print(log_name)
command = [python_interpreter, path+'main.py', '--use_trpo', 'True' '--path', data_path,'--subdir', subdir, '--log_name', log_name, '--it', iterations, '--n_steps', '1024', '--sigma', str(sigma), '--theta', str(theta)]
subprocess.run(command)
#push to git
# subprocess.run(['git', 'pull'])
# subprocess.run(['git', 'add', '-A'])
# subprocess.run(['git', 'commit', '-m', 'Automated push: Test for sigma = ' + str(sigma) + ' number ' + str(j)])
# subprocess.run(['git', 'push'])