-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathplot_test_results.py
55 lines (48 loc) · 2.87 KB
/
plot_test_results.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
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 17 20:19:33 2018
@author: lankuohsing
"""
# In[]
import numpy as np
import matplotlib.pyplot as plt
# In[]
S_list_1_256_25=[7938.778234988969, 8043.938608396231, 7845.124958448783, 7711.340344370845,7575.591452613173,
1669.992856806489, 8026.765173563922, 2159.3575423966054,1996.3627516456222, 7578.789943439138,
1286.0262030883089, 1204.9614613939639,1060.7126777328165, 1109.2662592432216, 1107.7725069996654,
1209.2646345896649,1042.7497697269864, 1128.2477009984768, 871.3352147289203, 784.4354591314998,
7949.114859403331, 8013.063413023013, 7866.768626174545, 7711.491691139294,
7580.073111643874, 1296.2373882229417, 5431.157300683879, 7849.7503520867485,
5280.815436978941, 3379.0753640326643, 1165.4902010305598, 986.9385497895842,
872.9254290654676, 1085.3838608999965, 798.8998316558319, 1032.8840217218078,
1560.8658596233627, 758.7862698361321, 742.8275590694046, 819.2805894404161,
8008.082152384726, 8024.803141630168, 7878.183571350209, 7694.219540684682,
7603.684162516833, 7821.118541209049, 3782.499825779083, 1725.2761286503621,
7731.812527880214, 7551.230081928405, 1221.9217451705265, 1362.8236201538411,
933.4647560166974, 1300.2233158165475, 615.1501260964421, 1156.3855149282554,
1020.5691216449825, 1027.6615161129864, 813.1484724207822, 526.5724917729872,
7982.946099837548, 8018.070247188548, 7871.941738764543, 7725.382300329317,
7602.329705132072, 1043.741013490956, 3725.097765430288, 7837.062098503938,
7708.035498522232, 7547.781484997707, 1004.8582275321966, 1127.8846767958805,
954.6432122352276, 1209.3068786833007, 838.9808213807116, 1066.3380080852382,
1372.6169775070734, 947.5317170645421, 693.2780128150763, 876.2807595338196]
S_np=np.array(S_list_1_256_25).reshape((4,4,5))
# In[]
num_layers_np=np.array([1,2,3,4])
lstm_size_np=np.array([32,64,128,256])
num_steps_np=np.array([5,10,15,20,25])
linestyle=['cx--','mo:','kp-.','bs--','p*:'] #红,绿,黄,蓝,粉,每个折线给不同的颜色
lstm_size_list=['32','64','128','256']
for i in range(S_np.shape[0]):
plt.figure(i,figsize=(9,9))
plt.title('Test Result Analysis:num_layers_np='+str(num_layers_np[i]),fontsize=25)
for j in range(S_np.shape[1]):
plt.plot(num_steps_np,S_np[i,j,:],linestyle[j],label='lstm_size='+lstm_size_list[j])
plt.tick_params(labelsize=20)
plt.legend(fontsize=20) # 显示图例
plt.xlabel("num_steps",fontsize=20)
plt.ylabel("score",fontsize=20)
plt.savefig('plot_test/'+'num_layers='+str(num_layers_np[i])+
'_lstm_size='+str(lstm_size_np[j])+'.png',dpi = 500)
plt.show()
# In[]