Spaces:
Running
Running
Update pages/13_FFNN.py
Browse files- pages/13_FFNN.py +9 -2
pages/13_FFNN.py
CHANGED
@@ -5,6 +5,7 @@ import torch.optim as optim
|
|
5 |
import torchvision
|
6 |
import torchvision.transforms as transforms
|
7 |
import matplotlib.pyplot as plt
|
|
|
8 |
import numpy as np
|
9 |
|
10 |
# Define the Feedforward Neural Network
|
@@ -118,7 +119,13 @@ if st.sidebar.button('Show Test Results'):
|
|
118 |
dataiter = iter(testloader)
|
119 |
images, labels = next(dataiter) # Use next function
|
120 |
imshow(torchvision.utils.make_grid(images))
|
121 |
-
|
122 |
outputs = net(images)
|
123 |
_, predicted = torch.max(outputs, 1)
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
import torchvision
|
6 |
import torchvision.transforms as transforms
|
7 |
import matplotlib.pyplot as plt
|
8 |
+
import pandas as pd
|
9 |
import numpy as np
|
10 |
|
11 |
# Define the Feedforward Neural Network
|
|
|
119 |
dataiter = iter(testloader)
|
120 |
images, labels = next(dataiter) # Use next function
|
121 |
imshow(torchvision.utils.make_grid(images))
|
122 |
+
|
123 |
outputs = net(images)
|
124 |
_, predicted = torch.max(outputs, 1)
|
125 |
+
|
126 |
+
st.write('GroundTruth vs Predicted')
|
127 |
+
results = pd.DataFrame({
|
128 |
+
'Ground Truth': labels.numpy(),
|
129 |
+
'Predicted': predicted.numpy()
|
130 |
+
})
|
131 |
+
st.table(results)
|