-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
43 lines (34 loc) · 1.2 KB
/
test.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
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
# 绘制acc及loss曲线
acc = np.random.rand(200)
val_acc = np.random.rand(200)
loss = np.random.rand(200)
val_loss = np.random.rand(200)
epochs_range = range(200)
plt.figure(figsize=(16, 16))
plt.subplot(2, 2, 1)
plt.plot(epochs_range, acc, label='Training Accuracy')
plt.plot(epochs_range, val_acc, label='Validation Accuracy')
plt.legend(loc='lower right')
plt.title('1')
plt.subplot(2, 2, 2)
plt.plot(epochs_range, loss, label='Training Loss')
plt.plot(epochs_range, val_loss, label='Validation Loss')
plt.legend(loc='upper right')
plt.title('2')
plt.subplot(2, 2, 3)
plt.plot(epochs_range, loss, label='Training Loss')
plt.plot(epochs_range, val_loss, label='Validation Loss')
plt.legend(loc='upper right')
plt.title('3')
plt.subplot(2, 2, 4)
plt.plot(epochs_range, loss, label='Training Loss')
plt.plot(epochs_range, val_loss, label='Validation Loss')
plt.legend(loc='upper right')
plt.title('4')
plt.show()
# img = plt.gcf()
# img.savefig("./data/img.png")
# img.clear()