Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lli
YM-Seminar
Commits
97be44db
Commit
97be44db
authored
Apr 21, 2021
by
lli
Browse files
update
parent
f276e3dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
train_dqn.py
View file @
97be44db
...
...
@@ -156,7 +156,7 @@ plt.legend(handles=[rewards, avg_rewards], loc='best')
plt
.
savefig
(
os
.
path
.
join
(
OUT_PATH
,
'training_total_rewards.png'
),
dpi
=
1200
,
transparent
=
True
,
bbox_inches
=
'tight'
)
plt
.
close
()
# Plot epsilon
# Plot epsilon
and tau
if
args
.
policy
==
'epsilon_greedy'
:
plt
.
plot
(
epsilon_value
)
plt
.
title
(
'Epsilon over time'
)
...
...
@@ -227,10 +227,14 @@ for ep in range(test_orders.shape[0]):
# Save the variables for evaluation
EVA_FILE
=
os
.
path
.
join
(
OUT_PATH
,
'evaluation'
)
save_list
(
total_reward_episode
,
EVA_FILE
,
'total_reward_episode_train'
)
save_list
(
total_reward_episode_eva
,
EVA_FILE
,
'total_reward_episode_eva'
)
save_list
(
num_no_capacity_eva
,
EVA_FILE
,
'num_no_capacity_eva'
)
save_list
(
accepted_orders_eva
,
EVA_FILE
,
'accepted_orders_eva'
)
save_list
(
epsilon_value
,
EVA_FILE
,
'epsilon_value'
)
if
args
.
policy
==
'epsilon_greedy'
:
save_list
(
epsilon_value
,
EVA_FILE
,
'epsilon_value'
)
else
:
save_list
(
tau_value
,
EVA_FILE
,
'tau_value'
)
# Load optimal solution
optimal_rewards
=
load
(
'dp/results.npy'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment