Update train.py
Browse files
train.py
CHANGED
|
@@ -192,10 +192,9 @@ def sim_loop(env, episodes, testing, Q_learning, algo, total_rewards, total_step
|
|
| 192 |
if Q_learning and total_steps>=2500 and total_steps%2500==0:
|
| 193 |
save(algo, total_rewards, total_steps)
|
| 194 |
print("start testing")
|
| 195 |
-
log_file.write(str(total_steps) + ",")
|
| 196 |
test_return = sim_loop(env_test, 25, True, Q_learning, algo, [], total_steps=0)
|
|
|
|
| 197 |
print("end of testing")
|
| 198 |
-
log_file.write(str(round(test_return, 2)) + "\n")
|
| 199 |
|
| 200 |
|
| 201 |
# if steps is close to episode limit (e.g. 950) we shut down actions and leave noise to get Terminal Transition:
|
|
|
|
| 192 |
if Q_learning and total_steps>=2500 and total_steps%2500==0:
|
| 193 |
save(algo, total_rewards, total_steps)
|
| 194 |
print("start testing")
|
|
|
|
| 195 |
test_return = sim_loop(env_test, 25, True, Q_learning, algo, [], total_steps=0)
|
| 196 |
+
log_file.write(str(total_steps) + "," + str(round(test_return, 2)) + "\n")
|
| 197 |
print("end of testing")
|
|
|
|
| 198 |
|
| 199 |
|
| 200 |
# if steps is close to episode limit (e.g. 950) we shut down actions and leave noise to get Terminal Transition:
|