PrakhAI commited on
Commit
8975baf
·
1 Parent(s): 7487052

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -65,5 +65,6 @@ else:
65
  st.write(cnn.apply({"params": params}, input).argmax(axis=1)[0])
66
 
67
  with st.expander("See first convolutional layer"):
68
- rgb = np.repeat(np.expand_dims(np.array(params["Conv_0"]["kernel"].squeeze()[:,:,0]+1)*127., axis=0), repeats=3, axis=0).astype(np.uint8).transpose(1,2,0)
 
69
  st.image(Image.fromarray(rgb, mode="RGB").resize((28, 28)))
 
65
  st.write(cnn.apply({"params": params}, input).argmax(axis=1)[0])
66
 
67
  with st.expander("See first convolutional layer"):
68
+ grid = np.array(params["Conv_0"]["kernel"].reshape((3, 3, 4, 8)).transpose(2,0,3,1).reshape(12, 24)+1)*127.
69
+ rgb = np.repeat(np.expand_dims(grid, axis=0), repeats=3, axis=0).astype(np.uint8).transpose(1,2,0)
70
  st.image(Image.fromarray(rgb, mode="RGB").resize((28, 28)))