<jupyter_start><jupyter_text>Visualizing the CNN layersHere I have visualized the 1st layer of the neural network<jupyter_code>import matplotlib.pyplot as plt
feature_maps = dic["1"].detach().numpy()
feature_maps = feature_maps.transpose(0,2,3,1)
print(feature_maps.shape)
square = 8
ix = 1
plt.figure(figsize=(15,15))
for _ in range(square):
  for _ in range(square):
     # specify subplot and turn of axis
     ax = plt.subplot(square, square, ix)
     ax.set_xticks([])
     ax.set_yticks([])
     # plot filter channel in grayscale
     plt.imshow(feature_maps[0, :, :, ix-1],cmap ="gray" )
     ix += 1
# show the figure
plt.show()<jupyter_output>(1, 224, 224, 64)<jupyter_text>Here I have visualized the last convolution layer of the neural network<jupyter_code>import matplotlib.pyplot as plt
feature_maps = dic["16"].detach().numpy()
feature_maps = feature_maps.transpose(0,2,3,1)
print(feature_maps.shape)
square = 8
ix = 1
plt.figure(figsize=(15,15))
for _ in range(square):
  for _ in range(square):
     # specify subplot and turn of axis
     ax = plt.subplot(square, square, ix)
     ax.set_xticks([])
     ax.set_yticks([])
     # plot filter channel in grayscale
     plt.imshow(feature_maps[0, :, :, ix-1],cmap ="gray" )
     ix += 1
# show the figure
plt.show()<jupyter_output>(1, 28, 28, 256)
{'fraction_non_alphanumeric': 0.13414634146341464, 'fraction_numerical': 0.035823170731707314, 'mean_word_length': 4.315789473684211, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '515797', 'license': 'MIT', 'n_tokens_mistral': 519, 'n_tokens_neox': 479, 'n_words': 121, 'path': 'convolutional-neural-networks/cifar-cnn/CNN_visualization.ipynb', 'repo_name': '153079019shariq/Udacity-DeepLearning', 'size': '1312'}