Vizualizing data lies at the core of any good data scientist’s skillset. It gives a holistic view of what could be hidden in the data. But with advanced in deep learning, you can visualise the entire deep learning process or just the Convolutional Neural Network you’ve built.
Now, you can even visualize an Artificial Neural Network using just a line of code. ANN Visualizer is a visualization library used to work with Keras. It makes use of python’s ‘graphviz’ library to create a neat and presentable graph of the neural network you’re building.
You can install the library using the below command:
pip install ann_visualizer
To generate the visualization, you need to follow the below command structure:
model
– Your Keras sequential modelview
– If set to true, it opens the graph preview after the command has been executedfilename
– Where to save the graph. (it’s saved in a ‘.gv’ file format)title
– The title for the visualized ANNBelow is an example of what the final visualization looks like:
Beautifully done, isn’t it? You can go through this GitHub repository here to look at a demo of how a model is created and visualized.
This is useful in a lot of ways. It can be used for teaching purposes when you want to explain how your NN looks like without having to run a lot of code. There have been previous efforts in this area but with the ease of effort and the beautifully optimised output, this is a library worth checking out.
It currently only visualizes dense layers but the developers has indicated that convolution and LSTM layers might be added soon. Keep in mind that this is still an unstable release so you might encounter a bug here and there but don’t let that put you off from trying it out!