-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluate_classification_training.py
66 lines (53 loc) · 2.17 KB
/
evaluate_classification_training.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
65
66
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
# dt = np.load('loss_experiments/vgg16_classification_losses.npy')
# (train_losses, train_accuracies, val_losses, val_accuracies) = dt
# x_data = np.arange(700)
# plt.plot(x_data, train_losses, label='Training CrossEntropy Loss')
# plt.plot(x_data, val_losses, label='Validation CrossEntropy Loss')
# plt.legend()
# plt.xlabel('Number of Epochs')
# plt.ylabel('Loss')
# plt.savefig('loss_experiments/vgg16_loss_plots')
# plt.close()
# plt.plot(x_data, train_accuracies, label='Training Set Accuracy')
# plt.plot(x_data, val_accuracies, label='Validation Set Accuracy')
# plt.legend()
# plt.xlabel('Number of Epochs')
# plt.ylabel('Accuracy')
# plt.savefig('loss_experiments/vgg16_accuracy_plots')
dt = np.load('loss_experiments/resnet_classification_losses.npy')
(train_losses, train_accuracies, val_losses, val_accuracies) = dt
x_data = np.arange(len(train_losses))
plt.close()
plt.plot(x_data, train_losses, label='Training CrossEntropy Loss')
plt.plot(x_data, val_losses, label='Validation CrossEntropy Loss')
plt.legend()
plt.xlabel('Number of Epochs')
plt.ylabel('Loss')
plt.savefig('loss_experiments/resnet_loss_plots')
plt.close()
plt.plot(x_data, train_accuracies, label='Training Set Accuracy')
plt.plot(x_data, val_accuracies, label='Validation Set Accuracy')
plt.legend()
plt.xlabel('Number of Epochs')
plt.ylabel('Accuracy')
plt.savefig('loss_experiments/resnet_accuracy_plots')
# dt = np.load('loss_experiments/baseline_classification_losses.npy')
# (train_losses, train_accuracies, val_losses, val_accuracies) = dt
# x_data = np.arange(len(train_losses))
# plt.close()
# plt.plot(x_data, train_losses, label='Training CrossEntropy Loss')
# plt.plot(x_data, val_losses, label='Validation CrossEntropy Loss')
# plt.legend()
# plt.xlabel('Number of Epochs')
# plt.ylabel('Loss')
# plt.savefig('loss_experiments/baseline_loss_plots')
# plt.close()
# plt.plot(x_data, train_accuracies, label='Training Set Accuracy')
# plt.plot(x_data, val_accuracies, label='Validation Set Accuracy')
# plt.legend()
# plt.xlabel('Number of Epochs')
# plt.ylabel('Accuracy')
# plt.savefig('loss_experiments/baseline_accuracy_plots')