PrakhAI commited on
Commit
e2e5d03
·
1 Parent(s): 7b426f6

Update app.py

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