Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,24 +53,24 @@ if st.button("Train"):
|
|
| 53 |
with col4:
|
| 54 |
st.write("Conv2D Layer-2")
|
| 55 |
sub1 = Model(inputs=model.inputs[0],outputs=model.layers[2].output)
|
| 56 |
-
fig,ax2 = plt.subplots(
|
| 57 |
-
for i in range(
|
| 58 |
ax2[i].imshow(sub1.predict(x_train[0:1,:].reshape(1,28,28,1))[0,:,:,i],cmap="gray")
|
| 59 |
ax2[i].axis("off")
|
| 60 |
st.pyplot(fig)
|
| 61 |
with col5:
|
| 62 |
st.write("Average Pooling Layer-2")
|
| 63 |
max2 = Model(inputs=model.inputs[0],outputs=model.layers[3].output)
|
| 64 |
-
fig,ax3 = plt.subplots(
|
| 65 |
-
for i in range(
|
| 66 |
ax3[i].imshow(max2.predict(x_train[0:1,:].reshape(1,28,28,1))[0,:,:,i],cmap="gray")
|
| 67 |
ax3[i].axis("off")
|
| 68 |
st.pyplot(fig)
|
| 69 |
with col6:
|
| 70 |
-
st.write("
|
| 71 |
sub3 = Model(inputs=model.inputs[0],outputs=model.layers[4].output)
|
| 72 |
-
fig,ax4 = plt.subplots(
|
| 73 |
-
for i in range(
|
| 74 |
ax4[i].imshow(sub3.predict(x_train[0:1,:].reshape(1,28,28,1))[0,:,:,i],cmap="gray")
|
| 75 |
ax4[i].axis("off")
|
| 76 |
st.pyplot(fig)
|
|
|
|
| 53 |
with col4:
|
| 54 |
st.write("Conv2D Layer-2")
|
| 55 |
sub1 = Model(inputs=model.inputs[0],outputs=model.layers[2].output)
|
| 56 |
+
fig,ax2 = plt.subplots(16,1,figsize=(8,6))
|
| 57 |
+
for i in range(16):
|
| 58 |
ax2[i].imshow(sub1.predict(x_train[0:1,:].reshape(1,28,28,1))[0,:,:,i],cmap="gray")
|
| 59 |
ax2[i].axis("off")
|
| 60 |
st.pyplot(fig)
|
| 61 |
with col5:
|
| 62 |
st.write("Average Pooling Layer-2")
|
| 63 |
max2 = Model(inputs=model.inputs[0],outputs=model.layers[3].output)
|
| 64 |
+
fig,ax3 = plt.subplots(16,1,figsize=(8,6))
|
| 65 |
+
for i in range(16):
|
| 66 |
ax3[i].imshow(max2.predict(x_train[0:1,:].reshape(1,28,28,1))[0,:,:,i],cmap="gray")
|
| 67 |
ax3[i].axis("off")
|
| 68 |
st.pyplot(fig)
|
| 69 |
with col6:
|
| 70 |
+
st.write("Conv2D Layer-3")
|
| 71 |
sub3 = Model(inputs=model.inputs[0],outputs=model.layers[4].output)
|
| 72 |
+
fig,ax4 = plt.subplots(120,1,figsize=(8,6))
|
| 73 |
+
for i in range(120):
|
| 74 |
ax4[i].imshow(sub3.predict(x_train[0:1,:].reshape(1,28,28,1))[0,:,:,i],cmap="gray")
|
| 75 |
ax4[i].axis("off")
|
| 76 |
st.pyplot(fig)
|