-
Notifications
You must be signed in to change notification settings - Fork 1
/
report_plots.py
68 lines (48 loc) · 1.79 KB
/
report_plots.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
56
57
58
59
60
61
62
63
64
import pickle
import matplotlib.pyplot as plt
from plot_lattice import plot_checkerboard
with open(r'Ising_state_gauge.pkl', 'rb') as f:
gauge_states = pickle.load(f)
with open(r'Ising_state_ice.pkl', 'rb') as f:
ice_states = pickle.load(f)
with open(r'gauge_hist.pkl', 'rb') as f:
gauge_hist = pickle.load(f)
with open(r'ice_hist.pkl', 'rb') as f:
ice_hist = pickle.load(f)
fig,ax = plt.subplots(nrows=1, ncols=2)
plt.subplots_adjust(wspace=0)
ax[0].plot(ice_hist['val_binary_accuracy'], 'k-', label="Validation accuracy")
ax[0].plot(ice_hist['binary_accuracy'], 'r--', label="Training accuracy")
ax[0].set_xlabel("Epochs")
ax[0].set_title("Square ice training accuracy")
ax[0].set_xlim(0, len(ice_hist['binary_accuracy'])-1)
plt.grid()
ax[1].plot(gauge_hist['val_binary_accuracy'], 'k-', label="Validation accuracy")
ax[1].plot(gauge_hist['binary_accuracy'], 'r--', label="Training accuracy")
ax[1].legend(fontsize=15)
ax[1].set_xlabel("Epochs")
plt.grid()
ax[1].set_yticks([])
ax[1].set_title("Gauge theory training accuracy")
ax[1].set_xlim(0, len(gauge_hist['binary_accuracy'])-1)
plt.show()
fig,ax = plt.subplots(nrows=2,ncols=2,figsize=(12,6))
plt.subplots_adjust(wspace=.05)
plt.tight_layout()
ax[0][0].set_title("Low temperature", fontsize=15)
ax[0][0].set_ylabel("Square Ice", fontsize=15)
ax[0][0].set_xticks([])
ax[0][0].set_yticks([])
ax[0][1].set_title("High temperature", fontsize=15)
ax[0][1].set_xticks([])
ax[0][1].set_yticks([])
ax[1][0].set_ylabel("Ising Gauge Theory", fontsize=15)
ax[1][0].set_xticks([])
ax[1][0].set_yticks([])
ax[1][1].set_xticks([])
ax[1][1].set_yticks([])
plot_checkerboard(ax[0][0], ice_states[10])
plot_checkerboard(ax[0][1], ice_states[75])
plot_checkerboard(ax[1][0], ice_states[10])
plot_checkerboard(ax[1][1], gauge_states[700])
plt.show()