Repository navigation
v0.4.0 — See it think (live mode)
See a network think. Load a full PyTorch model, run one forward pass, and watch the activations flow through the graph.
New features
- New command:
nnviz live model.pth. It loads a full PyTorch model. The page opens with the graph already drawn. - Run button: one forward pass with random input. Neurons light up layer by layer, like a wave. Intensity follows the activation value. The glow fades after about one second.
- Image input: feed a picture to a CNN. The tool resizes and normalizes it. Pillow does the decode.
- Output panel: top 8 classes with probability bars. The arrow marks the prediction.
- Input size probe: the server tries common input sizes until one works. One forward pass takes milliseconds.
Install
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install pillow # only for image input in live mode
pip install -e .
nnviz live model.pthDesign note
The roadmap said FastAPI and WebSocket. One forward pass is fast and atomic. One HTTP request returns all activations. The viewer animates the wave itself. So v0.4 stays on the stdlib server, with zero new dependencies. True streaming arrives with token-by-token LLMs.
Known limits
- Live mode runs PyTorch
nn.Modulefiles only. Astate_dictshows the graph but cannot run. - ONNX models do not run in live mode yet.
onnxruntimesupport is planned. - Activation vectors are capped at 4096 values per layer on the wire.
- The input probe tries common sizes. If your model needs an odd size, feed an image of the trained size.
Full changelog: v0.3.0...v0.4.0