Chapter 1 · Build the computation

Beyond linear boundaries

Use beyond linear boundaries to move the neural networks production brief toward a defensible release.

65–90 min4 key conceptsReviewed 26 Aug 2026
01 · Production proposition

A nonlinear sensor classifier defeats every classical baseline.

This lesson isolates beyond linear boundaries as one decision inside that system. The people affected are product users and operators; the learning data must carry event time, availability time, ownership, and version; and the operating envelope is a declared latency, cost, and operator-capacity budget.

Decision

Choose whether and how to use affine layers at a declared prediction cutoff.

Metric

Measure decision utility alongside calibration, slice reliability, and system latency—not model score alone.

Failure consequence

A nonlinear sensor classifier defeats every classical baseline. An unsafe release must degrade to a named baseline or the last known-good version.

02 · Intuition & prerequisites

Build the mental model before the machinery.

The core move is to treat beyond linear boundaries as a contract between data, a computation, and an action. Package preprocessing, vocabularies, weights, calibration, output semantics, and batch-one parity as one artifact. The implementation becomes easier to debug once you can state which inputs exist, which state is learned, what output means, and what must remain invariant after serialization.

01

affine layers

Define it in a hand-checkable form and name the prediction-time inputs.

02

ReLU/GELU

Connect it to the production metric and identify what it cannot guarantee.

03

cross-entropy

Stress it with a slice, a temporal boundary, and a failure-safe alternative.

04

chain rule

Stress it with a slice, a temporal boundary, and a failure-safe alternative.

Bring forward

Classical baselines, Trees & boosting

03 · Formal treatment

Name every symbol. Check every shape.

Backpropagated error is the central invariant for this lesson. The formula is useful only when its inputs match the production cutoff and its output maps to an action.

Formal treatment
δl=(Wl+1δl+1)φ(zl)\delta_l = \left(W_{l+1}^\top \delta_{l+1}\right) \odot \varphi'(z_l)

Backpropagated error

Symbol, shape or unit contract
SymbolMeaning / shape / unit
δ_lloss gradient at layer l
Wweight matrix
φ′activation derivative
Open derivation and numerical substitution

Start from the production quantity being optimized, substitute the observed values with their declared units, then isolate the model-controlled term. Preserve shape annotations at each step so broadcasting or aggregation cannot silently change the result.

  1. Write the named inputs: δ_l, W, φ′.
  2. Substitute one small, hand-checkable batch before vectorizing.
  3. Calculate an independent reference value and compare within a declared tolerance.
# equation → code contract
inputs = validate_shapes_and_units(batch)
value = compute_c09(inputs)
assert is_finite(value)
04 · Three views of the idea

Calculate it small. Shape it realistically. Break it on purpose.

HAND-CALCULATED TOY

A result you can reproduce on paper

Solve XOR with two hidden units and watch the representation become linearly separable.

  1. Write every input and unit.
  2. Substitute values into the backpropagated error equation above.
  3. Compare the result to one simple baseline and explain the direction of the difference.
PRODUCTION-SHAPED

The same reasoning under real constraints

Combine telemetry with categorical embeddings to predict whether an incident breaches its SLO.

The production record includes the data snapshot, transformation state, artifact identity, cutoff, score, decision, and the version of the policy that consumed it.

FAILURE / COUNTEREXAMPLE

The attractive result you should reject

An excessive learning rate causes NaNs; dead ReLUs and a BatchNorm train/eval mismatch hide the cause.

Diagnostic: replay the smallest failing slice from immutable inputs, then compare each boundary rather than retuning the model.

05 · Deterministic lab

Change one assumption and make the tradeoff visible.

This lab runs predefined TypeScript only. It never executes learner code. Use the slider, numeric input, reset, live text, or table—the computation is the same.

Exact computation

Optimizer stability lab

Sweep learning rate over a deterministic convex-plus-curvature loss.

Primary0.04813 loss
Secondaryw=0.310
DiagnosisStable

Assumption: Twenty gradient steps from w=4 on L(w)=w²/2.

Open nonvisual data table
ItemComputed stateInterpretation
step 13.52006.19520
step 52.11092.22801
step 101.11400.62050
step 150.58790.17281
step 200.31030.04813
06 · Production implications

Trace the complete operating path.

  1. 01

    Validate and version affine layers.

  2. 02

    Compute beyond linear boundaries from prediction-time-safe inputs.

  3. 03

    Persist model, feature, and configuration identities together.

  4. 04

    Serve or materialize behind explicit a declared latency, cost, and operator-capacity budget.

  5. 05

    Join telemetry to mature outcomes and retain a rollback path.

Observability

Join service health, input quality, prediction distributions, slice behavior, and mature outcomes by exact version.

Cost

Measure storage, preprocessing, compute, queueing, and human review under a representative arrival pattern.

Failure modes

An excessive learning rate causes NaNs; dead ReLUs and a BatchNorm train/eval mismatch hide the cause. Add a detector, owner, mitigation, and stop condition for this class of failure.

Alternatives

Compare a rule, a simpler statistical baseline, and a different system boundary before adding model complexity.

07 · Check understanding

Explain the contract, not just the vocabulary.

Browser-graded checkpointPass ≥ 80%
01Why do stacked linear layers remain linear?
02What does backprop compute?
03Why gradient-check a tiny network?
08 · Apply in production

Network from first principles

Specify a NumPy MLP, finite-difference checks, PyTorch parity, calibrated inference, and debugging report.

  • Forward/backward derivation
  • Gradient check plan
  • Optimizer/regularization ablations
  • Export and batch-one parity
Open assignment and rubric
09 · Sources & next depth

Read primary material with a purpose.

10 · Production resolution

Return to the opening failure.

Package preprocessing, vocabularies, weights, calibration, output semantics, and batch-one parity as one artifact.

For this lesson, the release evidence is a hand-checked formal result, deterministic simulation output, a ≥80% checkpoint, the production rubric, and a named fallback. The course resolves when the system can produce a small network built from forward pass through backpropagation and optimization.