---
title: "Visualizing piecewise linear neural networks"
description: "ReLU networks compute continuous piecewise-linear functions, and visualizing a small 2-input network layer by layer shows how each layer partitions the input plane into a polyhedral complex of linear regions, one per feasible activation pattern."
url: "https://swe.quest/articles/visualizing-piecewise-linear-neural-networks-9cac005d24a4f326"
canonical: "https://blog.janestreet.com/visualizing-piecewise-linear-neural-networks/"
source: "Jane Street Tech Blog"
published: "2024-07-22"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 3
tags: ["machine-learning"]
---

# Visualizing piecewise linear neural networks

A post on [Jane Street Tech Blog](https://swe.quest/sources/jane-street.md), published 2024-07-22, 3 min read, Deep dive. Original: [https://blog.janestreet.com/visualizing-piecewise-linear-neural-networks/](https://blog.janestreet.com/visualizing-piecewise-linear-neural-networks/)

## Summary

ReLU networks compute continuous piecewise-linear functions, and visualizing a small 2-input network layer by layer shows how each layer partitions the input plane into a polyhedral complex of linear regions, one per feasible activation pattern. With 8 neurons in the first layer, only 37 of the 256 possible activation patterns are feasible in 2D. Second-layer boundaries are straight inside first-layer regions and kink or terminate at region boundaries. The regions are computed by enumerating activation patterns per parent region and checking linear-constraint feasibility. Trained networks carve the plane into many more polygons than randomly initialized ones.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)

## Prerequisites

- neural network basics
- ReLU activations
- linear algebra basics

## Keywords

ReLU, LeakyReLU, polyhedral complex

## Related posts

- [Can you reverse engineer our neural network?](https://swe.quest/articles/can-you-reverse-engineer-our-neural-network-86a50d8d5fe35d5c.md): Jane Street Tech Blog · 2026-02-24 · Hard · 12 min read · Machine learning, AI safety, Cryptography, Algorithms
  A Jane Street ML puzzle shipped a fully specified, hand-built PyTorch network with integer weights that outputs 0 for almost every input, and the writeup follows one solver's path to cracking it.
- [Simple considerations for simple people building fancy neural networks](https://swe.quest/articles/simple-considerations-for-simple-people-building-fancy-neural-networks-490cc6f6d8bbcd9e.md): Hugging Face · 2021-02-25 · Medium · 8 min read · Model training, Debugging, Machine learning
  Building and debugging neural networks goes best with a disciplined workflow: inspect the data before modeling, establish simple baselines such as logistic regression on word2vec or fastText embeddings, and verify the implementation by overfitting a small batch (e.g. 16 examples) to near-zero loss with regularization off.
- [AI-generated synthetic neurons speed up brain mapping](https://swe.quest/articles/ai-generated-synthetic-neurons-speed-up-brain-mapping-8156c99955f6f7b2.md): Google Research · 2026-04-16 · Easy · 5 min read · Machine learning, Computer vision, Scientific computing, Model training
  MoGen, a point cloud flow matching model built on PointInfinity, generates realistic synthetic 3D neurite shapes.
- [Faster Retrieval for Better, More Efficient RAG](https://swe.quest/articles/faster-retrieval-for-better-more-efficient-rag-d17d027c0d4bf4d2.md): Apple Machine Learning Research · 2026-11-05 · Hard · 12 min read · Vector search, RAG & retrieval, Machine learning, Search, Performance engineering
  Maximum inner product search can be amortized by training small neural networks offline on a known query distribution, exploiting the fact that the max-inner-product function is the convex support function of the key set, whose gradient is the best-matching key.
- [NPHardEval Leaderboard: Unveiling the Reasoning Abilities of Large Language Models through Complexity Classes and Dynamic Updates](https://swe.quest/articles/nphardeval-leaderboard-unveiling-the-reasoning-abilities-of-large-language-a14bdd78f87edd9c.md): Hugging Face · 2024-02-02 · Medium · 5 min read · Evaluation, LLMs
  NPHardEval is a dynamic LLM reasoning benchmark of 900 automatically generated algorithmic questions: 9 problems (3 P, 3 NP-complete, 3 NP-hard), each at 10 difficulty levels.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
