Skip to content

v0.4.0 — See it think (live mode)

Choose a tag to compare

@CLVwp CLVwp released this 07 Oct 20:38
· 3 commits to main since this release

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.pth

Design 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.Module files only. A state_dict shows the graph but cannot run.
  • ONNX models do not run in live mode yet. onnxruntime support 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