Commit 97be44db authored by lli's avatar lli
Browse files

update

parent f276e3dc
...@@ -156,7 +156,7 @@ plt.legend(handles=[rewards, avg_rewards], loc='best') ...@@ -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.savefig(os.path.join(OUT_PATH, 'training_total_rewards.png'), dpi=1200, transparent=True, bbox_inches='tight')
plt.close() plt.close()
# Plot epsilon # Plot epsilon and tau
if args.policy == 'epsilon_greedy': if args.policy == 'epsilon_greedy':
plt.plot(epsilon_value) plt.plot(epsilon_value)
plt.title('Epsilon over time') plt.title('Epsilon over time')
...@@ -227,10 +227,14 @@ for ep in range(test_orders.shape[0]): ...@@ -227,10 +227,14 @@ for ep in range(test_orders.shape[0]):
# Save the variables for evaluation # Save the variables for evaluation
EVA_FILE = os.path.join(OUT_PATH, '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(total_reward_episode_eva, EVA_FILE, 'total_reward_episode_eva')
save_list(num_no_capacity_eva, EVA_FILE, 'num_no_capacity_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(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 # Load optimal solution
optimal_rewards = load('dp/results.npy') optimal_rewards = load('dp/results.npy')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment