Neural network diagram

Network architecture diagrams are worth drawing at two levels: the block level, showing layers and their shapes, and the neuron level, which is only useful for teaching.

For the block level, keep the tensor shapes on the diagram. They are what people actually check.


#When to reach for one

  • Model documentation and research write-ups.

  • Teaching material about how a network is structured.

  • Design discussions where the layer shapes are under debate.


#How to draw it in Capable

Route

Use when

TikZ

Publication-quality figures, including neuron-level detail.

Mermaid or D2

Block-level architecture with shapes annotated.

draw.io

Presentation diagrams with custom styling.


#A worked example

A block-level architecture with tensor shapes:

Neural network diagram

The source, which you can paste into a new diagram and edit:

flowchart LR
  I["Input<br/>224x224x3"] --> C1["Conv 3x3, 64<br/>224x224x64"]
  C1 --> P1["Max pool 2x2<br/>112x112x64"]
  P1 --> C2["Conv 3x3, 128<br/>112x112x128"]
  C2 --> P2["Max pool 2x2<br/>56x56x128"]
  P2 --> F["Flatten<br/>401408"]
  F --> D1["Dense 256"]
  D1 --> DO["Dropout 0.5"]
  DO --> D2["Dense 10"]
  D2 --> O(["Softmax"])

#A few things that catch people out

  • Put the tensor shapes on the diagram; they are the part people check against the code.

  • Neuron-level drawings are for teaching only. Nobody draws a real network that way.

  • Skip connections and residual blocks need to be visible, or the diagram misrepresents the model.



Approximately right is wrong here.