Visualizing the network

Let's visualize the architecture of the neural network we designed with Keras. The following code snippet will allow us to save the model (network) architecture in an image:

# pip install pydot_ng ## install pydot_ng if not already installedimport pydot_ng as pydotfrom keras.utils import plot_modelplot_model(model, to_file='../images/model.png')

The following screenshot shows the output of the previous code block, the neural network architecture:

Get Hands-On Image Processing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.