-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
32 lines (23 loc) · 755 Bytes
/
plot.py
File metadata and controls
32 lines (23 loc) · 755 Bytes
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 pandas as pd
import matplotlib.pyplot as plt
train_log = r'output\training_log.csv'
df = pd.read_csv(train_log)
epochs = df['epoch']
train_acc = df['training_acc']
val_acc = df['val_acc']
train_loss = df['training_loss']
val_loss = df['val_loss']
plt.plot(epochs, train_acc, 'b', label='Training acc', marker=">")
plt.plot(epochs, val_acc, 'r', label='Validation acc', marker="d")
plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.title('Training and validation accuracy')
plt.legend()
plt.figure()
plt.plot(epochs, train_loss, 'b', label='Training loss', marker=">")
plt.plot(epochs, val_loss, 'r', label='Validation loss', marker="d")
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.title('Training and validation loss')
plt.legend()
plt.show()