-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacc_plotter.py
32 lines (26 loc) · 1.09 KB
/
acc_plotter.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
import matplotlib.pyplot as plt
def plot_accuracy(history):
mae = history.history['mae']
loss = history.history['loss']
epochs = range(len(mae))
# -----------------------------------------------------------
# Retrieve a list of list results on training and test data
# sets for each training epoch
# -----------------------------------------------------------
plt.plot(epochs, mae, 'b', label='Training mae')
plt.plot(epochs, loss, 'r', label='Training Loss')
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.title('Training Accuracy Vs Testing Accuracy')
plt.legend()
plt.figure()
# # ------------------------------------------------
# # Plot mae and loss per epoch skipping the first 50
# # ------------------------------------------------
epochs = range(len(mae) - 50)
plt.plot(epochs, mae[50:], 'b', label='Training Loss')
plt.plot(epochs, loss[50:], 'r', label='Testing Loss')
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.title('Training Loss Vs Testing Losss')
plt.legend()