-
Notifications
You must be signed in to change notification settings - Fork 5
/
plotting.py
48 lines (42 loc) · 1.21 KB
/
plotting.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
import pandas as pd
import matplotlib.pyplot as plt
mask_train = pd.read_csv('save/log/mask_train_log.csv', index_col = 0)
mask_val = pd.read_csv('save/log/mask_val_log.csv', index_col = 0)
recom = pd.read_csv('save/log/recom_log.csv', index_col = 0)
print()
plt.figure()
plt.title('Total Loss')
plt.plot(mask_train.total, label='Train')
plt.plot(mask_val.total, label='Val')
plt.legend()
plt.savefig('save/log/total_loss.png')
plt.show()
plt.figure()
plt.title('CLS Loss')
plt.plot(mask_train.loss_classifier, label='Train')
plt.plot(mask_val.loss_classifier, label='Val')
plt.legend()
plt.savefig('save/log/classifier.png')
plt.show()
plt.figure()
plt.title('Train')
plt.plot(mask_train.loss_classifier, label='CLS')
plt.plot(mask_train.loss_mask, label='Mask')
plt.plot(mask_train.loss_box_reg, label='Box')
plt.legend()
plt.savefig('save/log/Train.png')
plt.show()
plt.figure()
plt.title('Val')
plt.plot(mask_val.loss_classifier, label='CLS')
plt.plot(mask_val.loss_mask, label='Mask')
plt.plot(mask_val.loss_box_reg, label='Box')
plt.legend()
plt.savefig('save/log/Val.png')
plt.show()
plt.figure()
plt.title('Recommendation Model')
plt.plot(recom.Train, label='Train')
plt.legend()
plt.savefig('save/log/Recom.png')
plt.show()