forked from xuetf/AlphaZero_Gobang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plot.py
23 lines (17 loc) · 844 Bytes
/
Plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import matplotlib.pyplot as plt
from Config import *
from Util import load_config
def draw_loss():
config = load_config(file_name=tmp_data_file + 'config-epochs-270-1.00.pkl', only_load_param=False)
print (config.loss_records)
combined_loss_list = [loss['combined_loss']for loss in config.loss_records]
policy_loss_list = [loss['policy_loss'] for loss in config.loss_records]
value_loss_list = [loss['value_loss'] for loss in config.loss_records]
entropy_list = [loss['entropy'] for loss in config.loss_records]
plt.plot(combined_loss_list, color='blue', label='combined_loss')
plt.plot(policy_loss_list, color='red', label='policy_loss')
plt.plot(value_loss_list, color='green', label='value_loss')
plt.plot(entropy_list, color='black', label='entropy')
plt.legend()
plt.show()
draw_loss()