March 2019
Intermediate to advanced
196 pages
4h 50m
English
There follows some code to print some before and after items to the screen. We are using the following code:
plt.subplot(nrows, ncols, index, **kwargs)
Where the subplot will take the index position on a grid with nrows rows and ncols columns, the index position starts at one in the upper-left corner and increases to the right to position the items of fashion:
number_of_items = 12 # how many items we will displayplt.figure(figsize=(20, 4))for i in range(number_of_items): # display items before compression graph = plt.subplot(2, number_of_items, i + 1) plt.imshow(x_test[i].reshape(28, 28)) plt.gray() graph.get_xaxis().set_visible(False) graph.get_yaxis().set_visible(False) # display items after decompression graph ...
Read now
Unlock full access