10 comments

[ 3.0 ms ] story [ 36.3 ms ] thread
This is really great. I can see myself using it.

I am not sure if AlexNet style Filter Opacity works (OSX, Chrome). It would be nice is changing opacity didn't change the filter positions.

With webgl the lines have pretty bad aliasing.
When I looked for a similar tool for a publication, this did not work for my use case as I have a fully-connected neural network with thousands of node per layer.

I falled back to draw.io wich is not specialized in neural networks by great at drawing schematics and very configurable.

For a recent publication, I had to create a neural network architecture diagram and tried it two ways - one by hacking someone's python code to create an isometric 3d diagram (https://i.ibb.co/HdBvTFk/fig2.png), the second using draw.io to create a 2d diagram (https://i.ibb.co/kmrfpVK/fig2a.png).

The 3D figure looks more appealing to my eye, but I went with the 2D one instead. The issue with architecture SVG generation code that I've seen is that it's inflexible once you want to do anything outside common layer computations or arrangements. I found someone's code that had a U-Net example and then manually had to go in and modify a whole bunch of stuff to get it to do just what I wanted. On top of that, I opted to do a bunch of postprocessing in an image editor anyway. More importantly, the 3D diagram is harder to parse for anyone looking to re-implement the model. Most (but not all) of the information is there, but you have to work for it. With the 2D diagram, the architecture is fully specified and, I believe, very easy to read (though I'm open to feedback). It's not as pretty, but ease of manual creation and the boost in clarity are more important.

NN-SVG looks like a better UI around a beautiful parametrized isometric 3D architecture diagram generator, but it also looks like it suffers from the drawbacks I have experienced in the past. Can it handle residual or skip connections? How easy is it to modify? If you are creating publication-quality architecture diagrams daily, automating it may save you time, but if you've gotta write a bunch of code every time your model's components are tweaked and only need pretty diagrams once and a while, you might be better off doing it by hand. Moreover, whether you use a 3D or 2D diagram, I think it's worth favoring a format that aids reproducibility.

(comment deleted)
I generated something not nearly as nice as this [1], which takes darknet network configurations and produce a (simple) visualization. I created this after spending quite a while messing with some LaTeX code and trying to get it to display something similar, which ultimately required me to manually tweak anyway.

I would highly recommend getting some tool for visualizing your networks, especially during design. It's much easier to reason about something you can see, rather than lines of text with random numbers.

[1] https://eng-git.canterbury.ac.nz/dba71/darknet-visual

> It's much easier to reason about something you can see, rather than lines of text with random numbers.

And It makes easier to work with a colleague and share different points of view :-)

Neat. A nice option would be to have presets for oblique projections for the 3D representations, making them axis-aligned for horizontal figures.
I wrote a Python package that uses graphviz to draw NN architectures of PyTorch neural nets[1]. Visualizing a neural net is a fun problem by itself; neural nets are essentially DAGs, but somehow recording the flow of data has lots of quirks (especially when dealing with RNNs or skip connections). There's a top-level view where you're just discussing about the layers as they are connected, and a low-level view where the output of each op matters.

[1] https://pytorchrec.readthedocs.io