Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

picture plot

import matplotlib.pyplot as plt
f, axarr = plt.subplots(3,4)
FIRST_IMAGE=0
SECOND_IMAGE=7
THIRD_IMAGE=26
CONVOLUTION_NUMBER = 1
from tensorflow.keras import models
layer_outputs = [layer.output for layer in model.layers]
activation_model = tf.keras.models.Model(inputs = model.input, outputs = layer_outputs)
for x in range(0,4):
  f1 = activation_model.predict(test_images[FIRST_IMAGE].reshape(1, 28, 28, 1))[x]
  axarr[0,x].imshow(f1[0, : , :, CONVOLUTION_NUMBER], cmap='inferno')
  axarr[0,x].grid(False)
  f2 = activation_model.predict(test_images[SECOND_IMAGE].reshape(1, 28, 28, 1))[x]
  axarr[1,x].imshow(f2[0, : , :, CONVOLUTION_NUMBER], cmap='inferno')
  axarr[1,x].grid(False)
  f3 = activation_model.predict(test_images[THIRD_IMAGE].reshape(1, 28, 28, 1))[x]
  axarr[2,x].imshow(f3[0, : , :, CONVOLUTION_NUMBER], cmap='inferno')
  axarr[2,x].grid(False)
Comment

PREVIOUS NEXT
Code Example
Python :: Function to plot as many bars as you wish 
Python :: longest common prefix 
Python :: sort list in python 
Python :: how to round whole numbers in python 
Python :: python print int operations 
Python :: list insert python 
Python :: python split() source code 
Python :: import random python 
Python :: palindrome of a number in python 
Python :: matplotlib window size 
Python :: join function in python 
Python :: python reverse range 
Python :: python selenium driver 
Python :: Removing Elements from Python Dictionary Using pop() method 
Python :: aws python sdk 
Python :: python online compiler 
Python :: python apply function 
Python :: Python list loop tutorial 
Python :: Remove an element from a Python list Using remove() method 
Python :: Set .difference() Operation in python3 
Python :: start virtualenv with python version 
Python :: python module search 
Python :: merge sorting in python 
Python :: python and pdf 
Python :: create a new column in pandas dataframe based on the existing columns 
Python :: django delete model from database 
Python :: pandas df iloc 
Python :: invalid literal for int() with base 10 in python 
Python :: count function in python 
Python :: python how to check if string is empty 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =