/
light_interpreter.py
37 lines (31 loc) · 1 KB
/
light_interpreter.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
import pickle
import argparse
import matplotlib.pyplot as plt
from numpy import mean as npmean
parser = argparse.ArgumentParser(description='check csgo-data style dataset')
parser.add_argument('-rp', help='the absolute path the file to be checked', type=str)
args = parser.parse_args()
root_path = args.rp
with open(root_path, 'rb') as filezin:
loss_dict = pickle.load(filezin)
try:
print(f"trained for {loss_dict['num_epochs']} epochs.")
except:
pass
try:
print(f"trained for {loss_dict['epochs']} epochs.")
except:
pass
print(f"learning rate: {loss_dict['lr']}")
print("\n")
print(f"median train loss: {npmean(loss_dict['losses'])}")
print(f"median train accuracy: {npmean(loss_dict['accuracies'])}")
print(f"median validation loss: {npmean(loss_dict['losses_val'])}")
print(f"median validation accuracy: {npmean(loss_dict['accuracies_val'])}")
print(loss_dict)
plt.subplot(111)
plt.plot(loss_dict["losses"])
plt.plot(loss_dict["losses_val"])
plt.ylabel("losses")
plt.xlabel("epochs")
plt.show()