NaNsense¶
Don't guess why your neural network fails to learn. Instead, have a look inside.
NaNsense is a PyTorch debugger that visualizes activations, gradients, weights, optimizer state and various statistics. You can pause, step batch-by-batch, and time-travel to a different epoch while training, and see exactly what every layer is doing.
🕹️ Try the Playground ✨ Integrate with one prompt 🤖 Debug with a coding agent
Here's how NaNsense can help:
- See what is actually going on. Visualize activations and gradients, find image patches with minimal or maximal activation for a given channel and simulate what each neuron is searching for (deep dream).
- Spot optimization bottlenecks. Discover insufficient receptive fields, measure neuron death, discover padding artifacts and spot gradient underflow.
The Showcase walks through all of these with real screenshots. Getting started runs an example in minutes, the UI guide tours every page, and the Wiring guide adds NaNsense to your own training loop — it's just a few lines of code. It also speaks MCP, so a coding agent can drive the debugger itself and look at the same views you do.
How is this different from wandb or TensorBoard?¶
Loggers record external metrics — the loss and accuracy curves you scroll through after the run. NaNsense is focused on understanding the internals of the network. A logger tells you that the loss stopped falling; NaNsense shows you why — say, half a layer's channels died after epoch three, or fp16 gradients are underflowing.